Commit ed9e5f23 authored by James Fargher's avatar James Fargher

Add repository storage move entity

parent d3eba34d
# frozen_string_literal: true
module API
module Entities
class ProjectRepositoryStorageMove < Grape::Entity
expose :id
expose :created_at
expose :human_state_name, as: :state
expose :source_storage_name
expose :destination_storage_name
expose :project, using: Entities::ProjectIdentity
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe API::Entities::ProjectRepositoryStorageMove do
describe '#as_json' do
subject { entity.as_json }
let(:storage_move) { build(:project_repository_storage_move, :scheduled, destination_storage_name: 'test_second_storage') }
let(:entity) { described_class.new(storage_move) }
it 'includes basic fields' do
is_expected.to include(
state: 'scheduled',
source_storage_name: 'default',
destination_storage_name: 'test_second_storage',
project: a_kind_of(Hash)
)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment