summaryrefslogtreecommitdiff
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authorImre Farkas <ifarkas@gitlab.com>2018-10-29 16:06:45 +0000
committerJan Provaznik <jprovaznik@gitlab.com>2018-10-29 16:06:45 +0000
commitb9652d8e4dc8544766c9371057be72cc26fe3a4b (patch)
treedd4c8407af4ef5d98a20f30069d3a348773dfbfa /spec/models/user_spec.rb
parentb5ca4ea15dee21b131b336d4189a75a283c8d1f1 (diff)
downloadgitlab-ce-b9652d8e4dc8544766c9371057be72cc26fe3a4b.tar.gz
[master] Persist only SHA digest of PersonalAccessToken#token
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index b3474e74aa4..4e7c8523e65 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -730,6 +730,14 @@ describe User do
expect(user.incoming_email_token).not_to be_blank
end
+
+ it 'uses SecureRandom to generate the incoming email token' do
+ expect(SecureRandom).to receive(:hex).and_return('3b8ca303')
+
+ user = create(:user)
+
+ expect(user.incoming_email_token).to eql('gitlab')
+ end
end
describe '#ensure_user_rights_and_limits' do