diff options
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 |