-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2284 from alphagov/dependabot/bundler/minitest-5.…
…19.0 Bump minitest from 5.18.1 to 5.19.0
- Loading branch information
Showing
2 changed files
with
9 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -346,22 +346,16 @@ class InvitingUsersTest < ActionDispatch::IntegrationTest | |
end | ||
|
||
should "raise an error if email address is not in Notify team" do | ||
raises_exception = lambda do |_request, _params| | ||
response = MiniTest::Mock.new | ||
response.expect :code, 400 | ||
response.expect :body, "Can't send to this recipient using a team-only API key" | ||
raise Notifications::Client::BadRequestError, response | ||
end | ||
response = stub("response", code: 400, body: "Can't send to this recipient using a team-only API key") | ||
User.stubs(:invite!).raises(Notifications::Client::BadRequestError, response) | ||
|
||
User.stub(:invite!, raises_exception) do | ||
perform_enqueued_jobs do | ||
visit new_user_invitation_path | ||
fill_in "Name", with: "Fred Bloggs" | ||
fill_in "Email", with: "[email protected]" | ||
click_button "Create user and send email" | ||
perform_enqueued_jobs do | ||
visit new_user_invitation_path | ||
fill_in "Name", with: "Fred Bloggs" | ||
fill_in "Email", with: "[email protected]" | ||
click_button "Create user and send email" | ||
|
||
assert_response_contains "Error: One or more recipients not in GOV.UK Notify team (code: 400)" | ||
end | ||
assert_response_contains "Error: One or more recipients not in GOV.UK Notify team (code: 400)" | ||
end | ||
end | ||
end | ||
|