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 | |
parent | 288e8c7c42bd9507725637dcf7e5b8e0eaa5229c (diff) | |
download | gitlab-ce-feature/user-audit-2.tar.gz |
add password and user specfeature/user-audit-2
-rw-r--r-- | spec/features/profiles/password_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/spec/features/profiles/password_spec.rb b/spec/features/profiles/password_spec.rb index 4cbdd89d46f..a5ddb2b5ad0 100644 --- a/spec/features/profiles/password_spec.rb +++ b/spec/features/profiles/password_spec.rb @@ -25,7 +25,7 @@ describe 'Profile > Password', feature: true do end end - it 'does not contains the current password field after an error' do + it 'does not contain the current password field after an error' do fill_passwords('mypassword', 'mypassword2') expect(page).to have_no_field('user[current_password]') 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 |