Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-06-01 20:59:04 +0300
committerStan Hu <stanhu@gmail.com>2018-06-01 20:59:04 +0300
commit81e899ea7141b34a7860f308327249784fb5d6cc (patch)
treedfb47ec0b8c866c8232b367d2d9d82a1887024bc /spec/models/concerns
parent160cc6cd7b0218cdd1e210c4133fd469ffacf656 (diff)
parentb5c706326ada2c0d213dd512842c5f677d9d94f9 (diff)
Merge branch 'sh-bump-ruby-2.4' into 'master'
Upgrade to Ruby 2.4.4 See merge request gitlab-org/gitlab-ce!19055
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/has_variable_spec.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/models/concerns/has_variable_spec.rb b/spec/models/concerns/has_variable_spec.rb
index f87869a2fdc..3fbe86c5b56 100644
--- a/spec/models/concerns/has_variable_spec.rb
+++ b/spec/models/concerns/has_variable_spec.rb
@@ -45,8 +45,10 @@ describe HasVariable do
end
it 'fails to decrypt if iv is incorrect' do
- subject.encrypted_value_iv = SecureRandom.hex
+ # attr_encrypted expects the IV to be 16 bytes and base64-encoded
+ subject.encrypted_value_iv = [SecureRandom.hex(8)].pack('m')
subject.instance_variable_set(:@value, nil)
+
expect { subject.value }
.to raise_error(OpenSSL::Cipher::CipherError, 'bad decrypt')
end