X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/39963d8c70b6d810ebc396997651a895d1f75344..4470cb88e0556041452719a3b4d7396cb3e3ec4a:/test/controllers/confirmations_controller_test.rb diff --git a/test/controllers/confirmations_controller_test.rb b/test/controllers/confirmations_controller_test.rb index 79213441f..774efdb9c 100644 --- a/test/controllers/confirmations_controller_test.rb +++ b/test/controllers/confirmations_controller_test.rb @@ -13,7 +13,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest { :controller => "confirmations", :action => "confirm", :display_name => "username" } ) assert_routing( - { :path => "/user/username/confirm/resend", :method => :get }, + { :path => "/user/username/confirm/resend", :method => :post }, { :controller => "confirmations", :action => "confirm_resend", :display_name => "username" } ) @@ -37,7 +37,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_get user = build(:user, :pending) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) get user_confirm_path, :params => { :display_name => user.display_name, :confirm_string => confirm_string } @@ -48,7 +48,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_get_already_confirmed user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) # Get the confirmation page @@ -68,7 +68,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_success_no_token_no_referer user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) post logout_path @@ -81,7 +81,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_success_good_token_no_referer user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) post user_confirm_path, :params => { :display_name => user.display_name, :confirm_string => confirm_string } @@ -91,7 +91,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_success_bad_token_no_referer user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) post logout_path @@ -105,7 +105,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_success_no_token_with_referer user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) post logout_path @@ -118,7 +118,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_success_good_token_with_referer user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) post user_confirm_path, :params => { :display_name => user.display_name, :confirm_string => confirm_string, :referer => new_diary_entry_path } @@ -128,7 +128,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_success_bad_token_with_referer user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) post logout_path @@ -142,7 +142,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_expired_token user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) travel 2.weeks do @@ -155,7 +155,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_already_confirmed user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) post user_confirm_path, :params => { :display_name => user.display_name, :confirm_string => confirm_string, :referer => new_diary_entry_path } @@ -172,7 +172,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_deleted user = build(:user, :pending) stub_gravatar_request(user.email) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } confirm_string = User.find_by(:email => user.email).generate_token_for(:new_user) User.find_by(:display_name => user.display_name).hide! @@ -189,11 +189,11 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_resend_success user = build(:user, :pending) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } assert_difference "ActionMailer::Base.deliveries.size", 1 do perform_enqueued_jobs do - get user_confirm_resend_path(user) + post user_confirm_resend_path(user) end end @@ -210,13 +210,13 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_resend_deleted user = build(:user, :pending) - post user_new_path, :params => { :user => user.attributes } + post users_path, :params => { :user => user.attributes } User.find_by(:display_name => user.display_name).hide! assert_no_difference "ActionMailer::Base.deliveries.size" do perform_enqueued_jobs do - get user_confirm_resend_path(user) + post user_confirm_resend_path(user) end end @@ -227,7 +227,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest def test_confirm_resend_unknown_user assert_no_difference "ActionMailer::Base.deliveries.size" do perform_enqueued_jobs do - get user_confirm_resend_path(:display_name => "No Such User") + post user_confirm_resend_path(:display_name => "No Such User") end end