X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0a046673d630a4618c27559875ce613465d85d3c..2dfe6f3f2e911101f4e4e3b90a00e2ae97725d04:/test/controllers/users_controller_test.rb diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb index 402129d32..a530a6f85 100644 --- a/test/controllers/users_controller_test.rb +++ b/test/controllers/users_controller_test.rb @@ -312,15 +312,13 @@ class UsersControllerTest < ActionDispatch::IntegrationTest assert_difference "User.count", 1 do assert_difference "ActionMailer::Base.deliveries.size", 1 do - perform_enqueued_jobs do - post user_save_path, :params => { :read_ct => 1, :read_tou => 1 } - end + post user_save_path, :params => { :read_ct => 1, :read_tou => 1 } + assert_enqueued_with :job => ActionMailer::MailDeliveryJob, + :args => proc { |args| args[3][:args][2] == welcome_path(:editor => "id", :zoom => 1, :lat => 2, :lon => 3) } + perform_enqueued_jobs end end - assert_equal welcome_path(:editor => "id", :zoom => 1, :lat => 2, :lon => 3), - User.find_by(:email => user.email).tokens.order("id DESC").first.referer - ActionMailer::Base.deliveries.clear end