summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-06-01 17:59:04 +0000
committerStan Hu <stanhu@gmail.com>2018-06-01 17:59:04 +0000
commit81e899ea7141b34a7860f308327249784fb5d6cc (patch)
treedfb47ec0b8c866c8232b367d2d9d82a1887024bc /spec
parent160cc6cd7b0218cdd1e210c4133fd469ffacf656 (diff)
parentb5c706326ada2c0d213dd512842c5f677d9d94f9 (diff)
downloadgitlab-ce-81e899ea7141b34a7860f308327249784fb5d6cc.tar.gz
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')
-rw-r--r--spec/initializers/secret_token_spec.rb2
-rw-r--r--spec/models/concerns/has_variable_spec.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/spec/initializers/secret_token_spec.rb b/spec/initializers/secret_token_spec.rb
index d56e14e0e0b..c3dfd7bedbe 100644
--- a/spec/initializers/secret_token_spec.rb
+++ b/spec/initializers/secret_token_spec.rb
@@ -1,5 +1,5 @@
require 'spec_helper'
-require_relative '../../config/initializers/secret_token'
+require_relative '../../config/initializers/01_secret_token'
describe 'create_tokens' do
include StubENV
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