diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-11-27 16:34:05 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-11-27 16:34:05 +0300 |
commit | 37add27a00d38e4edaaec945ed9f44a123523884 (patch) | |
tree | 4d034575e8c6ee6019125ed820309989c25106ea /spec/lib/gitlab/crypto_helper_spec.rb | |
parent | 3dfbfa4e4f2ce962660dc534ac7a8c670049b506 (diff) |
Improve token authenticable tests and exceptions
Diffstat (limited to 'spec/lib/gitlab/crypto_helper_spec.rb')
-rw-r--r-- | spec/lib/gitlab/crypto_helper_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/lib/gitlab/crypto_helper_spec.rb b/spec/lib/gitlab/crypto_helper_spec.rb index bd3a38bfbaa..05cc6cf15de 100644 --- a/spec/lib/gitlab/crypto_helper_spec.rb +++ b/spec/lib/gitlab/crypto_helper_spec.rb @@ -5,7 +5,7 @@ describe Gitlab::CryptoHelper do it 'generates SHA256 digest Base46 encoded' do digest = described_class.sha256('some-value') - expect(digest).to match %r{^[A-Za-z0-9+/=]+$} + expect(digest).to match %r{\A[A-Za-z0-9+/=]+\z} expect(digest).to eq digest.strip end end @@ -14,7 +14,8 @@ describe Gitlab::CryptoHelper do it 'is Base64 encoded string without new line character' do encrypted = described_class.aes256_gcm_encrypt('some-value') - expect(encrypted).to match %r{^[A-Za-z0-9+/=]+$} + expect(encrypted).to match %r{\A[A-Za-z0-9+/=]+\z} + expect(encrypted).not_to include "\n" end end |