Skip to content

Commit

Permalink
✅ Fix confirmations controller test
Browse files Browse the repository at this point in the history
  • Loading branch information
djpremier committed Apr 7, 2023
1 parent cbe90cd commit aaf25c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def show
redirect_to_link = signed_in_resource.build_auth_url(redirect_url, redirect_headers)
else
redirect_to_link = DeviseTokenAuth::Url.generate(redirect_url, redirect_header_options)
end
end

redirect_to(redirect_to_link)
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,12 @@ def token_and_client_config_from(body)

describe 'failure' do
test 'user should not be confirmed' do
assert_raises(ActionController::RoutingError) do
get :show, params: { confirmation_token: 'bogus' }
end
get :show,
params: { confirmation_token: 'bogus',
redirect_url: @redirect_url }

assert_redirected_to(/^#{@redirect_url}/)

@resource = assigns(:resource)
refute @resource.confirmed?
end
Expand Down

0 comments on commit aaf25c0

Please sign in to comment.