summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-06-06 19:14:01 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-06-06 19:14:01 +0000
commit0ba21860c5ca3df1a1aca916cb0094802e76fd75 (patch)
treef12ead214d1b8003a9acabadf6f1d079042d150a /spec/lib
parentf73292e471232683f314f58e9c58bacac5beb519 (diff)
parent9264203103bbd2b4f46ce777304f210b07765c43 (diff)
downloadgitlab-ce-0ba21860c5ca3df1a1aca916cb0094802e76fd75.tar.gz
Merge branch 'issue_3359' into 'master'
Remove duplicated notification settings and add unique index See merge request !4472
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/database/migration_helpers_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb
index 35ade7a2be0..83ddabe6b0b 100644
--- a/spec/lib/gitlab/database/migration_helpers_spec.rb
+++ b/spec/lib/gitlab/database/migration_helpers_spec.rb
@@ -16,14 +16,21 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
end
context 'using PostgreSQL' do
- it 'creates the index concurrently' do
- expect(Gitlab::Database).to receive(:postgresql?).and_return(true)
+ before { expect(Gitlab::Database).to receive(:postgresql?).and_return(true) }
+ it 'creates the index concurrently' do
expect(model).to receive(:add_index).
with(:users, :foo, algorithm: :concurrently)
model.add_concurrent_index(:users, :foo)
end
+
+ it 'creates unique index concurrently' do
+ expect(model).to receive(:add_index).
+ with(:users, :foo, { algorithm: :concurrently, unique: true })
+
+ model.add_concurrent_index(:users, :foo, unique: true)
+ end
end
context 'using MySQL' do
@@ -31,7 +38,7 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
expect(Gitlab::Database).to receive(:postgresql?).and_return(false)
expect(model).to receive(:add_index).
- with(:users, :foo)
+ with(:users, :foo, {})
model.add_concurrent_index(:users, :foo)
end