diff options
author | James Lopez <james@jameslopez.es> | 2017-06-09 12:14:05 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-06-09 12:14:05 +0200 |
commit | b8a51d947da1240df3c071c08c66c17e244e38ed (patch) | |
tree | 389704e70b0084131d3a31ed245c5592ce257c2d /spec/models/user_spec.rb | |
parent | 288e8c7c42bd9507725637dcf7e5b8e0eaa5229c (diff) | |
download | gitlab-ce-feature/user-audit-2.tar.gz |
add password and user specfeature/user-audit-2
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index d5bd9946ab6..afebe611c88 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1857,4 +1857,16 @@ describe User, models: true do user.invalidate_merge_request_cache_counts end end + + describe 'audit changes' do + let!(:user) { create(:user) } + + it 'audits an email change' do + expect { user.update!(email: 'test@example.com') }.to change { AuditEvent.count }.by(1) + end + + it 'audits a password change' do + expect { user.update!(password: 'asdfasdf', password_confirmation: 'asdfasdf') }.to change { AuditEvent.count }.by(1) + end + end end |