diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-08 03:06:48 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-08 03:06:48 +0000 |
commit | 18a102a5b95198b6bc8db2589de6353997a33543 (patch) | |
tree | 93aac1bb58c3bfcd7421c279a6436fa50ea05537 /spec/lib/gitlab/gpg_spec.rb | |
parent | 1adb4373ba840a9bc771a8c9196f7183fd98b2b8 (diff) | |
download | gitlab-ce-18a102a5b95198b6bc8db2589de6353997a33543.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/gpg_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gpg_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/lib/gitlab/gpg_spec.rb b/spec/lib/gitlab/gpg_spec.rb index 8ba7ea4d237..52d6a86f7d0 100644 --- a/spec/lib/gitlab/gpg_spec.rb +++ b/spec/lib/gitlab/gpg_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Gitlab::Gpg do @@ -63,7 +65,7 @@ describe Gitlab::Gpg do it 'downcases the email' do public_key = double(:key) fingerprints = double(:fingerprints) - uid = double(:uid, name: 'Nannie Bernhard', email: 'NANNIE.BERNHARD@EXAMPLE.COM') + uid = double(:uid, name: +'Nannie Bernhard', email: +'NANNIE.BERNHARD@EXAMPLE.COM') raw_key = double(:raw_key, uids: [uid]) allow(Gitlab::Gpg::CurrentKeyChain).to receive(:fingerprints_from_key).with(public_key).and_return(fingerprints) allow(GPGME::Key).to receive(:find).with(:public, anything).and_return([raw_key]) @@ -78,8 +80,8 @@ describe Gitlab::Gpg do it 'rejects non UTF-8 names and addresses' do public_key = double(:key) fingerprints = double(:fingerprints) - email = "\xEEch@test.com".force_encoding('ASCII-8BIT') - uid = double(:uid, name: 'Test User', email: email) + email = (+"\xEEch@test.com").force_encoding('ASCII-8BIT') + uid = double(:uid, name: +'Test User', email: email) raw_key = double(:raw_key, uids: [uid]) allow(Gitlab::Gpg::CurrentKeyChain).to receive(:fingerprints_from_key).with(public_key).and_return(fingerprints) allow(GPGME::Key).to receive(:find).with(:public, anything).and_return([raw_key]) |