summaryrefslogtreecommitdiff
path: root/spec/rubocop/cop/migration/drop_table_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:18:33 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:18:33 +0000
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /spec/rubocop/cop/migration/drop_table_spec.rb
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
downloadgitlab-ce-f64a639bcfa1fc2bc89ca7db268f594306edfd7c.tar.gz
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'spec/rubocop/cop/migration/drop_table_spec.rb')
-rw-r--r--spec/rubocop/cop/migration/drop_table_spec.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/spec/rubocop/cop/migration/drop_table_spec.rb b/spec/rubocop/cop/migration/drop_table_spec.rb
index d783cb56203..f1bd710f5e6 100644
--- a/spec/rubocop/cop/migration/drop_table_spec.rb
+++ b/spec/rubocop/cop/migration/drop_table_spec.rb
@@ -1,15 +1,16 @@
# frozen_string_literal: true
require 'fast_spec_helper'
-require 'rubocop'
require_relative '../../../../rubocop/cop/migration/drop_table'
RSpec.describe RuboCop::Cop::Migration::DropTable do
- include CopHelper
-
subject(:cop) { described_class.new }
context 'when in deployment migration' do
+ let(:msg) do
+ '`drop_table` in deployment migrations requires downtime. Drop tables in post-deployment migrations instead.'
+ end
+
before do
allow(cop).to receive(:in_deployment_migration?).and_return(true)
end
@@ -30,7 +31,7 @@ RSpec.describe RuboCop::Cop::Migration::DropTable do
expect_offense(<<~PATTERN)
def up
drop_table :table
- ^^^^^^^^^^ #{described_class::MSG}
+ ^^^^^^^^^^ #{msg}
end
PATTERN
end
@@ -41,7 +42,7 @@ RSpec.describe RuboCop::Cop::Migration::DropTable do
expect_offense(<<~PATTERN)
def change
drop_table :table
- ^^^^^^^^^^ #{described_class::MSG}
+ ^^^^^^^^^^ #{msg}
end
PATTERN
end
@@ -63,7 +64,7 @@ RSpec.describe RuboCop::Cop::Migration::DropTable do
expect_offense(<<~PATTERN)
def up
execute "DROP TABLE table"
- ^^^^^^^ #{described_class::MSG}
+ ^^^^^^^ #{msg}
end
PATTERN
end
@@ -74,7 +75,7 @@ RSpec.describe RuboCop::Cop::Migration::DropTable do
expect_offense(<<~PATTERN)
def change
execute "DROP TABLE table"
- ^^^^^^^ #{described_class::MSG}
+ ^^^^^^^ #{msg}
end
PATTERN
end