Welcome to mirror list, hosted at ThFree Co, Russian Federation.

repository_storage_move_spec.rb « snippets « entities « api « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a848afbcff991bb8ae80313bf31ff9c5bc21c780 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe API::Entities::Snippets::RepositoryStorageMove do
  describe '#as_json' do
    subject { entity.as_json }

    let(:default_storage) { 'default' }
    let(:second_storage) { 'test_second_storage' }
    let(:storage_move) { create(:snippet_repository_storage_move, :scheduled, destination_storage_name: second_storage) }
    let(:entity) { described_class.new(storage_move) }

    it 'includes basic fields' do
      allow(Gitlab.config.repositories.storages).to receive(:keys).and_return(%W[#{default_storage} #{second_storage}])

      is_expected.to include(
        state: 'scheduled',
        source_storage_name: default_storage,
        destination_storage_name: second_storage,
        snippet: a_kind_of(Hash)
      )
    end
  end
end