Skip to content

Commit

Permalink
Add test for SSO Push updates to emails_controller_test
Browse files Browse the repository at this point in the history
As far as I can tell we've been sending push updates (to the applications
a user has access to) when a user's email changes since the functionality
was added to Signon[1] and gds-sso[2] in 2012.

Although we're still sending those push updates from the new
`Users::EmailsController` (added in #2509) we weren't testing it in the
controller test. I'm adding a test (copied from the previous commit) to
avoid regressions in future.

[1]: f339848
[2]: alphagov/gds-sso@8c0888c
  • Loading branch information
chrisroos committed Nov 16, 2023
1 parent 2e87e64 commit d14faa3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/controllers/users/emails_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ class Users::EmailsControllerTest < ActionController::TestCase
put :update, params: { user_id: user, user: { email: "[email protected]" } }
end

should "push changes out to apps" do
user = create(:user)
PermissionUpdater.expects(:perform_on).with(user).once

put :update, params: { user_id: user, user: { email: "[email protected]" } }
end

should "redirect to edit user page and display success notice" do
user = create(:user, email: "[email protected]")

Expand Down

0 comments on commit d14faa3

Please sign in to comment.