Commit dca9980f authored by Igor Drozdov's avatar Igor Drozdov

Fix 2.7 warning for attr_encrypted

default_value_for uses attr_changed? that raises a warning

since it's not critical to skip setting a default value for
encrypted attributes in specs, we can skip it
parent 9991065d
...@@ -58,7 +58,6 @@ module DeprecationToolkitEnv ...@@ -58,7 +58,6 @@ module DeprecationToolkitEnv
spec/support/gitlab_experiment.rb spec/support/gitlab_experiment.rb
activerecord-6.0.3.4/lib/active_record/migration.rb activerecord-6.0.3.4/lib/active_record/migration.rb
devise-4.7.3/lib/devise/test/controller_helpers.rb devise-4.7.3/lib/devise/test/controller_helpers.rb
attr_encrypted-3.1.0/lib/attr_encrypted/adapters/active_record.rb
grape-1.5.1/lib/grape/middleware/stack.rb grape-1.5.1/lib/grape/middleware/stack.rb
grape-1.5.1/lib/grape/validations/validators/coerce.rb grape-1.5.1/lib/grape/validations/validators/coerce.rb
grape_logging-1.8.3/lib/grape_logging/middleware/request_logger.rb grape_logging-1.8.3/lib/grape_logging/middleware/request_logger.rb
......
...@@ -44,7 +44,6 @@ RSpec.describe BulkInsertSafe do ...@@ -44,7 +44,6 @@ RSpec.describe BulkInsertSafe do
insecure_mode: false insecure_mode: false
default_value_for :enum_value, 'case_1' default_value_for :enum_value, 'case_1'
default_value_for :secret_value, 'my-secret'
default_value_for :sha_value, '2fd4e1c67a2d28fced849ee1bb76e7391b93eb12' default_value_for :sha_value, '2fd4e1c67a2d28fced849ee1bb76e7391b93eb12'
default_value_for :jsonb_value, { "key" => "value" } default_value_for :jsonb_value, { "key" => "value" }
...@@ -53,11 +52,11 @@ RSpec.describe BulkInsertSafe do ...@@ -53,11 +52,11 @@ RSpec.describe BulkInsertSafe do
end end
def self.valid_list(count) def self.valid_list(count)
Array.new(count) { |n| new(name: "item-#{n}") } Array.new(count) { |n| new(name: "item-#{n}", secret_value: 'my-secret') }
end end
def self.invalid_list(count) def self.invalid_list(count)
Array.new(count) { new } Array.new(count) { new(secret_value: 'my-secret') }
end end
end end
end end
...@@ -102,7 +101,7 @@ RSpec.describe BulkInsertSafe do ...@@ -102,7 +101,7 @@ RSpec.describe BulkInsertSafe do
context 'primary keys' do context 'primary keys' do
it 'raises error if primary keys are set prior to insertion' do it 'raises error if primary keys are set prior to insertion' do
item = bulk_insert_item_class.new(name: 'valid', id: 10) item = bulk_insert_item_class.new(name: 'valid', id: 10, secret_value: 'my-secret')
expect { bulk_insert_item_class.bulk_insert!([item]) } expect { bulk_insert_item_class.bulk_insert!([item]) }
.to raise_error(bulk_insert_item_class::PrimaryKeySetError) .to raise_error(bulk_insert_item_class::PrimaryKeySetError)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment