diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-07-25 21:33:32 +1200 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-07-26 00:13:25 +1200 |
commit | d4ef3be35b63f3ef022e21d6ba56ffe41b8f192c (patch) | |
tree | f091fea00139368a7401238930d9bc809616b6f3 /spec | |
parent | 595a092a083a9a16cad12dc663cad1a674551a51 (diff) | |
download | gitlab-ce-d4ef3be35b63f3ef022e21d6ba56ffe41b8f192c.tar.gz |
Frozen string cannot change encodingfrozen_string_spec_support
This was shown in specs but surely this will be happening in application
code as well if this method is passes a frozen string.
We were also trying to force_encode a OmniAuth::AuthHash which had the
very confusing behaviour of returning nil when it was sent a method that
it did not define. Fix that by only force_encoding a String.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/auth/o_auth/auth_hash_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/lib/gitlab/auth/o_auth/auth_hash_spec.rb b/spec/lib/gitlab/auth/o_auth/auth_hash_spec.rb index 40001cea22e..a5436149818 100644 --- a/spec/lib/gitlab/auth/o_auth/auth_hash_spec.rb +++ b/spec/lib/gitlab/auth/o_auth/auth_hash_spec.rb @@ -40,7 +40,11 @@ describe Gitlab::Auth::OAuth::AuthHash do last_name: last_name_ascii, name: name_ascii, nickname: nickname_ascii, - uid: uid_ascii + uid: uid_ascii, + address: { + locality: 'some locality', + country: 'some country' + } } end @@ -51,6 +55,7 @@ describe Gitlab::Auth::OAuth::AuthHash do it { expect(auth_hash.username).to eql nickname_utf8 } it { expect(auth_hash.name).to eql name_utf8 } it { expect(auth_hash.password).not_to be_empty } + it { expect(auth_hash.location).to eq 'some locality, some country' } end context 'email not provided' do |