diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-07 03:09:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-07 03:09:26 +0300 |
commit | 418a39f6c20ebaf9572c4ef3ae924b0c6ffc5e3b (patch) | |
tree | c4ae73eee4e0a2ba535e87893858d9e76778d09d /spec/rubocop/cop/migration | |
parent | 2633d5ef5ed868eccb174c6ff644a3fb8224f990 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/rubocop/cop/migration')
7 files changed, 0 insertions, 71 deletions
diff --git a/spec/rubocop/cop/migration/add_limit_to_text_columns_spec.rb b/spec/rubocop/cop/migration/add_limit_to_text_columns_spec.rb index f4695ff8d2d..899872859a9 100644 --- a/spec/rubocop/cop/migration/add_limit_to_text_columns_spec.rb +++ b/spec/rubocop/cop/migration/add_limit_to_text_columns_spec.rb @@ -17,7 +17,6 @@ RSpec.describe RuboCop::Cop::Migration::AddLimitToTextColumns do it 'registers an offense' do expect_offense(<<~RUBY) class TestTextLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false disable_ddl_transaction! def up @@ -54,7 +53,6 @@ RSpec.describe RuboCop::Cop::Migration::AddLimitToTextColumns do it 'registers no offense' do expect_no_offenses(<<~RUBY) class TestTextLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false disable_ddl_transaction! def up @@ -90,8 +88,6 @@ RSpec.describe RuboCop::Cop::Migration::AddLimitToTextColumns do it 'registers no offense' do expect_no_offenses(<<~RUBY) class TestTextLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up create_table :test_text_limits, id: false do |t| t.integer :test_id, null: false @@ -113,7 +109,6 @@ RSpec.describe RuboCop::Cop::Migration::AddLimitToTextColumns do it 'registers an offense' do expect_offense(<<~RUBY) class TestTextLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false disable_ddl_transaction! def up @@ -146,7 +141,6 @@ RSpec.describe RuboCop::Cop::Migration::AddLimitToTextColumns do it 'registers no offenses' do expect_no_offenses(<<~RUBY) class TestTextLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false disable_ddl_transaction! def up @@ -168,8 +162,6 @@ RSpec.describe RuboCop::Cop::Migration::AddLimitToTextColumns do it 'registers no offense' do expect_no_offenses(<<~RUBY) class TestTextLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up drop_table :no_offense_on_down end @@ -194,7 +186,6 @@ RSpec.describe RuboCop::Cop::Migration::AddLimitToTextColumns do it 'registers no offense' do expect_no_offenses(<<~RUBY) class TestTextLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false disable_ddl_transaction! def up diff --git a/spec/rubocop/cop/migration/add_timestamps_spec.rb b/spec/rubocop/cop/migration/add_timestamps_spec.rb index ef5a856722f..2a11d46be6e 100644 --- a/spec/rubocop/cop/migration/add_timestamps_spec.rb +++ b/spec/rubocop/cop/migration/add_timestamps_spec.rb @@ -9,8 +9,6 @@ RSpec.describe RuboCop::Cop::Migration::AddTimestamps do let(:migration_with_add_timestamps) do %q( class Users < ActiveRecord::Migration[4.2] - DOWNTIME = false - def change add_column(:users, :username, :text) add_timestamps(:users) @@ -22,8 +20,6 @@ RSpec.describe RuboCop::Cop::Migration::AddTimestamps do let(:migration_without_add_timestamps) do %q( class Users < ActiveRecord::Migration[4.2] - DOWNTIME = false - def change add_column(:users, :username, :text) end @@ -34,8 +30,6 @@ RSpec.describe RuboCop::Cop::Migration::AddTimestamps do let(:migration_with_add_timestamps_with_timezone) do %q( class Users < ActiveRecord::Migration[4.2] - DOWNTIME = false - def change add_column(:users, :username, :text) add_timestamps_with_timezone(:users) @@ -52,8 +46,6 @@ RSpec.describe RuboCop::Cop::Migration::AddTimestamps do it 'registers an offense when the "add_timestamps" method is used' do expect_offense(<<~RUBY) class Users < ActiveRecord::Migration[4.2] - DOWNTIME = false - def change add_column(:users, :username, :text) add_timestamps(:users) diff --git a/spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb b/spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb index 15e947a1e53..ac814c10550 100644 --- a/spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb +++ b/spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb @@ -18,8 +18,6 @@ RSpec.describe RuboCop::Cop::Migration::ComplexIndexesRequireName do it 'registers an offense' do expect_offense(<<~RUBY) class TestComplexIndexes < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up create_table :test_table do |t| t.integer :column1, null: false @@ -46,8 +44,6 @@ RSpec.describe RuboCop::Cop::Migration::ComplexIndexesRequireName do it 'registers no offense' do expect_no_offenses(<<~RUBY) class TestComplexIndexes < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up create_table :test_table do |t| t.integer :column1, null: false @@ -74,8 +70,6 @@ RSpec.describe RuboCop::Cop::Migration::ComplexIndexesRequireName do it 'registers an offense' do expect_offense(<<~RUBY) class TestComplexIndexes < ActiveRecord::Migration[6.0] - DOWNTIME = false - disable_ddl_transaction! def up @@ -101,8 +95,6 @@ RSpec.describe RuboCop::Cop::Migration::ComplexIndexesRequireName do it 'registers no offenses' do expect_no_offenses(<<~RUBY) class TestComplexIndexes < ActiveRecord::Migration[6.0] - DOWNTIME = false - INDEX_NAME = 'my_test_name' disable_ddl_transaction! @@ -135,8 +127,6 @@ RSpec.describe RuboCop::Cop::Migration::ComplexIndexesRequireName do it 'registers no offenses' do expect_no_offenses(<<~RUBY) class TestComplexIndexes < ActiveRecord::Migration[6.0] - DOWNTIME = false - disable_ddl_transaction! def up diff --git a/spec/rubocop/cop/migration/datetime_spec.rb b/spec/rubocop/cop/migration/datetime_spec.rb index 3854ddfe99c..95a875b3baa 100644 --- a/spec/rubocop/cop/migration/datetime_spec.rb +++ b/spec/rubocop/cop/migration/datetime_spec.rb @@ -9,8 +9,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do let(:create_table_migration_without_datetime) do %q( class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change create_table :users do |t| t.string :username, null: false @@ -24,8 +22,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do let(:create_table_migration_with_datetime_with_timezone) do %q( class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change create_table :users do |t| t.string :username, null: false @@ -39,8 +35,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do let(:add_column_migration_with_datetime) do %q( class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change add_column(:users, :username, :text) add_column(:users, :last_sign_in, :datetime) @@ -52,8 +46,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do let(:add_column_migration_with_timestamp) do %q( class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change add_column(:users, :username, :text) add_column(:users, :last_sign_in, :timestamp) @@ -65,8 +57,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do let(:add_column_migration_without_datetime) do %q( class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change add_column(:users, :username, :text) end @@ -77,8 +67,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do let(:add_column_migration_with_datetime_with_timezone) do %q( class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change add_column(:users, :username, :text) add_column(:users, :last_sign_in, :datetime_with_timezone) @@ -95,8 +83,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do it 'registers an offense when the ":datetime" data type is used on create_table' do expect_offense(<<~RUBY) class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change create_table :users do |t| t.string :username, null: false @@ -111,8 +97,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do it 'registers an offense when the ":timestamp" data type is used on create_table' do expect_offense(<<~RUBY) class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change create_table :users do |t| t.string :username, null: false @@ -135,8 +119,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do it 'registers an offense when the ":datetime" data type is used on add_column' do expect_offense(<<~RUBY) class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change add_column(:users, :username, :text) add_column(:users, :last_sign_in, :datetime) @@ -149,8 +131,6 @@ RSpec.describe RuboCop::Cop::Migration::Datetime do it 'registers an offense when the ":timestamp" data type is used on add_column' do expect_offense(<<~RUBY) class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def change add_column(:users, :username, :text) add_column(:users, :last_sign_in, :timestamp) diff --git a/spec/rubocop/cop/migration/prevent_strings_spec.rb b/spec/rubocop/cop/migration/prevent_strings_spec.rb index a9b62f23a77..d1760c2db88 100644 --- a/spec/rubocop/cop/migration/prevent_strings_spec.rb +++ b/spec/rubocop/cop/migration/prevent_strings_spec.rb @@ -15,8 +15,6 @@ RSpec.describe RuboCop::Cop::Migration::PreventStrings do it 'registers an offense' do expect_offense(<<~RUBY, msg: "Do not use the `string` data type, use `text` instead.[...]") class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up create_table :users do |t| t.string :username, null: false @@ -46,8 +44,6 @@ RSpec.describe RuboCop::Cop::Migration::PreventStrings do it 'registers no offense' do expect_no_offenses(<<~RUBY) class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up create_table :users do |t| t.integer :not_a_string, null: false @@ -65,8 +61,6 @@ RSpec.describe RuboCop::Cop::Migration::PreventStrings do it 'registers no offense' do expect_no_offenses(<<~RUBY) class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up create_table :users do |t| t.text :username, null: false @@ -87,8 +81,6 @@ RSpec.describe RuboCop::Cop::Migration::PreventStrings do it 'registers no offense' do expect_no_offenses(<<~RUBY) class TestStringArrays < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up create_table :test_string_arrays, id: false do |t| t.integer :test_id, null: false @@ -108,8 +100,6 @@ RSpec.describe RuboCop::Cop::Migration::PreventStrings do it 'registers no offense' do expect_no_offenses(<<~RUBY) class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up remove_column :users, :bio remove_column :users, :url @@ -137,8 +127,6 @@ RSpec.describe RuboCop::Cop::Migration::PreventStrings do it 'registers no offense' do expect_no_offenses(<<~RUBY) class Users < ActiveRecord::Migration[6.0] - DOWNTIME = false - def up create_table :users do |t| t.string :username, null: false diff --git a/spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb b/spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb index b3e66492d83..c65f86d1e13 100644 --- a/spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb +++ b/spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb @@ -15,8 +15,6 @@ RSpec.describe RuboCop::Cop::Migration::ReferToIndexByName do it 'registers an offense' do expect_offense(<<~RUBY, msg: 'migration methods that refer to existing indexes must do so by name') class TestReferToIndexByName < ActiveRecord::Migration[6.0] - DOWNTIME = false - INDEX_NAME = 'my_test_name' disable_ddl_transaction! @@ -63,8 +61,6 @@ RSpec.describe RuboCop::Cop::Migration::ReferToIndexByName do it 'registers no offenses' do expect_no_offenses(<<~RUBY) class TestReferToIndexByName < ActiveRecord::Migration[6.0] - DOWNTIME = false - disable_ddl_transaction! def up diff --git a/spec/rubocop/cop/migration/timestamps_spec.rb b/spec/rubocop/cop/migration/timestamps_spec.rb index 91bb5c1b05b..2f99a3ff35b 100644 --- a/spec/rubocop/cop/migration/timestamps_spec.rb +++ b/spec/rubocop/cop/migration/timestamps_spec.rb @@ -9,8 +9,6 @@ RSpec.describe RuboCop::Cop::Migration::Timestamps do let(:migration_with_timestamps) do %q( class Users < ActiveRecord::Migration[4.2] - DOWNTIME = false - def change create_table :users do |t| t.string :username, null: false @@ -25,8 +23,6 @@ RSpec.describe RuboCop::Cop::Migration::Timestamps do let(:migration_without_timestamps) do %q( class Users < ActiveRecord::Migration[4.2] - DOWNTIME = false - def change create_table :users do |t| t.string :username, null: false @@ -40,8 +36,6 @@ RSpec.describe RuboCop::Cop::Migration::Timestamps do let(:migration_with_timestamps_with_timezone) do %q( class Users < ActiveRecord::Migration[4.2] - DOWNTIME = false - def change create_table :users do |t| t.string :username, null: false @@ -61,8 +55,6 @@ RSpec.describe RuboCop::Cop::Migration::Timestamps do it 'registers an offense when the "timestamps" method is used' do expect_offense(<<~RUBY) class Users < ActiveRecord::Migration[4.2] - DOWNTIME = false - def change create_table :users do |t| t.string :username, null: false |