Skip to content

Commit

Permalink
Merge pull request #2284 from alphagov/dependabot/bundler/minitest-5.…
Browse files Browse the repository at this point in the history
…19.0

Bump minitest from 5.18.1 to 5.19.0
  • Loading branch information
floehopper authored Jul 27, 2023
2 parents 3f1bdbe + 0d843a6 commit 0858317
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ GEM
mime-types-data (3.2023.0218.1)
mini_mime (1.1.2)
mini_portile2 (2.8.4)
minitest (5.18.1)
minitest (5.19.0)
mocha (2.1.0)
ruby2_keywords (>= 0.0.5)
msgpack (1.6.0)
Expand Down
22 changes: 8 additions & 14 deletions test/integration/inviting_users_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0858317

Please sign in to comment.