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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb')
-rw-r--r--spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb b/spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb
index 223730f87c0..806d57af4b3 100644
--- a/spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb
+++ b/spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb
@@ -16,4 +16,21 @@ RSpec.describe Gitlab::Database::AsyncIndexes::PostgresAsyncIndex, type: :model
it { is_expected.to validate_presence_of(:definition) }
it { is_expected.to validate_length_of(:definition).is_at_most(definition_limit) }
end
+
+ describe 'scopes' do
+ let!(:async_index_creation) { create(:postgres_async_index) }
+ let!(:async_index_destruction) { create(:postgres_async_index, :with_drop) }
+
+ describe '.to_create' do
+ subject { described_class.to_create }
+
+ it { is_expected.to contain_exactly(async_index_creation) }
+ end
+
+ describe '.to_drop' do
+ subject { described_class.to_drop }
+
+ it { is_expected.to contain_exactly(async_index_destruction) }
+ end
+ end
end