Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions spec/controllers/users/passwords_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,16 @@
end

it 'creates a user Event for the password change' do
stub_sign_in(create(:user))
user = stub_sign_in

params = { password: 'salty new password' }
patch :update, params: { update_user_password_form: params }
params = {
password: 'salty new password',
password_confirmation: 'salty new password',
Copy link
Contributor Author

@aduth aduth Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of password_confirmation here is due to some code drift where we added the requirement to enter the new password twice in #8220. Since we weren't verifying anything in this spec previous, this test never began failing when adding that requirement.

}

expect do
patch :update, params: { update_user_password_form: params }
end.to change { user.events.password_changed.size }.by 1
end

it 'sends a security event' do
Expand Down