diff options
author | Stan Hu <stanhu@gmail.com> | 2015-07-29 07:32:01 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-08-05 00:35:53 -0700 |
commit | 0c1ccda43fe04300a07a5f046a7c1cbae56cff32 (patch) | |
tree | 6d8a997d15e58813a78e0f2806543e0b2388f756 /spec/models/user_spec.rb | |
parent | 4c9ba632e9468a0a8f37a031d0be90645ee6be2c (diff) | |
download | gitlab-ce-0c1ccda43fe04300a07a5f046a7c1cbae56cff32.tar.gz |
Add "Confirm user" button in user admin page
Closes #2116
Closes https://github.com/gitlabhq/gitlabhq/issues/9502
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 922e9ebf844..876cfb1204a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -184,6 +184,19 @@ describe User do it { is_expected.to respond_to(:private_token) } end + describe '#confirm' do + let(:user) { create(:user, confirmed_at: nil, unconfirmed_email: 'test@gitlab.com') } + + it 'returns unconfirmed' do + expect(user.confirmed?).to be_falsey + end + + it 'confirms a user' do + user.confirm! + expect(user.confirmed?).to be_truthy + end + end + describe '#to_reference' do let(:user) { create(:user) } |