summaryrefslogtreecommitdiff
path: root/spec/rubocop
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-03-28 05:48:53 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-03-28 05:48:53 +0800
commitf234d9f12d6a054412067b955d3b765325d4ccc6 (patch)
tree146bdd3834e7b1302ade4982aa67aee8010567db /spec/rubocop
parent6fce4a49d53963ad68b6dcb09d04b8c2488ffb7b (diff)
downloadgitlab-ce-f234d9f12d6a054412067b955d3b765325d4ccc6.tar.gz
Properly handle `ee` migration specs
Diffstat (limited to 'spec/rubocop')
-rw-r--r--spec/rubocop/cop/migration/update_column_in_batches_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/rubocop/cop/migration/update_column_in_batches_spec.rb b/spec/rubocop/cop/migration/update_column_in_batches_spec.rb
index 1c8ab0ad5d2..cba01400d85 100644
--- a/spec/rubocop/cop/migration/update_column_in_batches_spec.rb
+++ b/spec/rubocop/cop/migration/update_column_in_batches_spec.rb
@@ -93,4 +93,22 @@ describe RuboCop::Cop::Migration::UpdateColumnInBatches do
it_behaves_like 'a migration file with no spec file'
it_behaves_like 'a migration file with a spec file'
end
+
+ context 'EE migrations' do
+ let(:spec_filepath) { tmp_rails_root.join('ee', 'spec', 'migrations', 'my_super_migration_spec.rb') }
+
+ context 'in a migration' do
+ let(:migration_filepath) { tmp_rails_root.join('ee', 'db', 'migrate', '20121220064453_my_super_migration.rb') }
+
+ it_behaves_like 'a migration file with no spec file'
+ it_behaves_like 'a migration file with a spec file'
+ end
+
+ context 'in a post migration' do
+ let(:migration_filepath) { tmp_rails_root.join('ee', 'db', 'post_migrate', '20121220064453_my_super_migration.rb') }
+
+ it_behaves_like 'a migration file with no spec file'
+ it_behaves_like 'a migration file with a spec file'
+ end
+ end
end