X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0c7c950149888777e186e2eb7525b37f340bc6f0..075f8df94afd8ad7b8d4ee684d844e25da5349c2:/test/integration/user_creation_test.rb?ds=sidebyside diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb index beb05a98a..4aae1046b 100644 --- a/test/integration/user_creation_test.rb +++ b/test/integration/user_creation_test.rb @@ -30,12 +30,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_difference("User.count", 0) do assert_difference("ActionMailer::Base.deliveries.size", 0) do perform_enqueued_jobs do - post "/user/new", + post "/user", :params => { :user => { :email => dup_email, :display_name => display_name, :pass_crypt => "testtest", - :pass_crypt_confirmation => "testtest", - :consider_pd => "1" } } + :pass_crypt_confirmation => "testtest" } } end end end @@ -51,14 +50,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_difference("User.count", 0) do assert_no_difference("ActionMailer::Base.deliveries.size") do perform_enqueued_jobs do - post "/user/new", + post "/user", :params => { :user => { :email => dup_email, :display_name => display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest", - :auth_provider => "auth_provider", - :auth_uid => "123454321", - :consider_pd => "1" } } + :auth_provider => "google", + :auth_uid => "123454321" } } end end end @@ -74,7 +72,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_difference("User.count", 0) do assert_difference("ActionMailer::Base.deliveries.size", 0) do perform_enqueued_jobs do - post "/user/new", + post "/user", :params => { :user => { :email => email, :display_name => dup_display_name, :pass_crypt => "testtest", @@ -93,12 +91,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_difference("User.count", 0) do assert_difference("ActionMailer::Base.deliveries.size", 0) do perform_enqueued_jobs do - post "/user/new", + post "/user", :params => { :user => { :email => email, :display_name => display_name, :pass_crypt => "testtest", - :pass_crypt_confirmation => "blahblah", - :consider_pd => "1" } } + :pass_crypt_confirmation => "blahblah" } } end end end @@ -113,12 +110,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_difference("User.count", 0) do assert_no_difference("ActionMailer::Base.deliveries.size") do perform_enqueued_jobs do - post "/user/new", + post "/user", :params => { :user => { :email => email, :display_name => dup_display_name, - :auth_provider => "provider", - :auth_uid => "123454321", - :consider_pd => "1" } } + :auth_provider => "google", + :auth_uid => "123454321" } } end end end @@ -134,12 +130,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_difference("User.count", 1) do assert_difference("ActionMailer::Base.deliveries.size", 1) do perform_enqueued_jobs do - post "/user/new", + post "/user", :params => { :user => { :email => new_email, :display_name => display_name, :pass_crypt => "testtest", - :pass_crypt_confirmation => "testtest", - :consider_pd => "1" } } + :pass_crypt_confirmation => "testtest" } } assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name follow_redirect! end @@ -158,7 +153,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest found_confirmation_url = register_email.parts.first.parts.first.to_s =~ %r{\shttp://test.host(/\S+)\s} assert found_confirmation_url confirmation_url = Regexp.last_match(1) - ActionMailer::Base.deliveries.clear post confirmation_url @@ -171,13 +165,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest end # Check that the user can successfully recover their password - def test_lost_password_recovery_success - # Open the lost password form - # Submit the lost password form - # Check the e-mail - # Submit the reset password token - # Check that the password has changed, and the user can login - end + # def test_lost_password_recovery_success + # Open the lost password form + # Submit the lost password form + # Check the e-mail + # Submit the reset password token + # Check that the password has changed, and the user can login + # end def test_user_create_redirect new_email = "redirect_tester@osm.org" @@ -188,12 +182,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_difference("User.count") do assert_difference("ActionMailer::Base.deliveries.size", 1) do perform_enqueued_jobs do - post "/user/new", + post "/user", :params => { :user => { :email => new_email, :display_name => display_name, :pass_crypt => password, - :pass_crypt_confirmation => password, - :consider_pd => "1" }, + :pass_crypt_confirmation => password }, :referer => referer } assert_response(:redirect) assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name @@ -217,8 +210,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_response :success assert_template "confirmations/confirm" - ActionMailer::Base.deliveries.clear - # Go to the confirmation page get "/user/#{display_name}/confirm", :params => { :referer => "/welcome", :confirm_string => confirm_string } assert_response :success @@ -234,6 +225,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest def test_user_create_openid_success new_email = "newtester-openid@osm.org" display_name = "new_tester-openid" + openid_url = "http://localhost:1000/new.tester" auth_uid = "http://localhost:1123/new.tester" OmniAuth.config.add_mock(:openid, @@ -243,26 +235,23 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_difference("User.count") do assert_difference("ActionMailer::Base.deliveries.size", 1) do perform_enqueued_jobs do - post auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new") - assert_redirected_to auth_success_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new") + post auth_path(:provider => "openid", :openid_url => openid_url, :origin => "/user/new") + assert_redirected_to auth_success_path(:provider => "openid", :openid_url => openid_url, :origin => "/user/new") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => new_email, :auth_provider => "openid", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, :display_name => display_name, :auth_provider => "openid", - :auth_uid => "http://localhost:1123/new.tester", - :consider_pd => "1" } } + :auth_uid => auth_uid } } end end end # Check the page assert_redirected_to :controller => :confirmations, :action => :confirm, :display_name => display_name - - ActionMailer::Base.deliveries.clear end def test_user_create_openid_duplicate_email @@ -284,8 +273,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_response :success assert_template "users/new" assert_select "form > div > input.is-invalid#user_email" - - ActionMailer::Base.deliveries.clear end def test_user_create_openid_failure @@ -302,12 +289,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest end end end - - ActionMailer::Base.deliveries.clear end def test_user_create_openid_redirect - auth_uid = "12345654321" + openid_url = "http://localhost:1000/new.tester" + auth_uid = "http://localhost:1123/new.tester" new_email = "redirect_tester_openid@osm.org" display_name = "redirect_tester_openid" @@ -318,18 +304,17 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_difference("User.count") do assert_difference("ActionMailer::Base.deliveries.size", 1) do perform_enqueued_jobs do - post auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new") - assert_redirected_to auth_success_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new") + post auth_path(:provider => "openid", :openid_url => openid_url, :origin => "/user/new") + assert_redirected_to auth_success_path(:provider => "openid", :openid_url => openid_url, :origin => "/user/new") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => new_email, :auth_provider => "openid", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, :display_name => display_name, :auth_provider => "openid", - :auth_uid => auth_uid, - :consider_pd => "1" } } + :auth_uid => auth_uid } } follow_redirect! end end @@ -350,8 +335,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_response :success assert_template "confirmations/confirm" - ActionMailer::Base.deliveries.clear - # Go to the confirmation page get "/user/#{display_name}/confirm", :params => { :referer => "/welcome", :confirm_string => confirm_string } assert_response :success @@ -366,7 +349,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest def test_user_create_google_success new_email = "newtester-google@osm.org" - verified_email = UsersController.message_hmac(new_email) + email_hmac = UsersController.message_hmac(new_email) display_name = "new_tester-google" auth_uid = "123454321" @@ -382,17 +365,16 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "google") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => new_email, :verified_email => verified_email, + :email => new_email, :email_hmac => email_hmac, :auth_provider => "google", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, :display_name => display_name, :auth_provider => "google", - :auth_uid => auth_uid, - :consider_pd => "1" }, - :verified_email => verified_email } + :auth_uid => auth_uid }, + :email_hmac => email_hmac } assert_redirected_to welcome_path follow_redirect! end @@ -402,8 +384,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the page assert_response :success assert_template "site/welcome" - - ActionMailer::Base.deliveries.clear end def test_user_create_google_duplicate_email @@ -420,15 +400,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "google") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email, - :verified_email => UsersController.message_hmac(dup_user.email), + :email_hmac => UsersController.message_hmac(dup_user.email), :auth_provider => "google", :auth_uid => auth_uid follow_redirect! assert_response :success assert_template "users/new" assert_select "form > div > input.is-invalid#user_email" - - ActionMailer::Base.deliveries.clear end def test_user_create_google_failure @@ -446,13 +424,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest end end end - - ActionMailer::Base.deliveries.clear end def test_user_create_google_redirect orig_email = "redirect_tester_google_orig@google.com" - verified_email = UsersController.message_hmac(orig_email) + email_hmac = UsersController.message_hmac(orig_email) new_email = "redirect_tester_google@osm.org" display_name = "redirect_tester_google" auth_uid = "123454321" @@ -469,16 +445,15 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "google") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => orig_email, :verified_email => verified_email, + :email => orig_email, :email_hmac => email_hmac, :auth_provider => "google", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, - :verified_email => verified_email, + :email_hmac => email_hmac, :display_name => display_name, :auth_provider => "google", - :auth_uid => auth_uid, - :consider_pd => "1" } } + :auth_uid => auth_uid } } assert_response :redirect follow_redirect! end @@ -500,8 +475,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_response :success assert_template "confirmations/confirm" - ActionMailer::Base.deliveries.clear - # Go to the confirmation page get "/user/#{display_name}/confirm", :params => { :referer => "/welcome", :confirm_string => confirm_string } assert_response :success @@ -516,7 +489,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest def test_user_create_facebook_success new_email = "newtester-facebook@osm.org" - verified_email = UsersController.message_hmac(new_email) + email_hmac = UsersController.message_hmac(new_email) display_name = "new_tester-facebook" auth_uid = "123454321" @@ -531,17 +504,16 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "facebook") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => new_email, :verified_email => verified_email, + :email => new_email, :email_hmac => email_hmac, :auth_provider => "facebook", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, :display_name => display_name, :auth_provider => "facebook", - :auth_uid => auth_uid, - :consider_pd => "1" }, - :verified_email => verified_email } + :auth_uid => auth_uid }, + :email_hmac => email_hmac } assert_redirected_to welcome_path follow_redirect! end @@ -551,8 +523,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the page assert_response :success assert_template "site/welcome" - - ActionMailer::Base.deliveries.clear end def test_user_create_facebook_duplicate_email @@ -568,15 +538,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "facebook") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email, - :verified_email => UsersController.message_hmac(dup_user.email), + :email_hmac => UsersController.message_hmac(dup_user.email), :auth_provider => "facebook", :auth_uid => auth_uid follow_redirect! assert_response :success assert_template "users/new" assert_select "form > div > input.is-invalid#user_email" - - ActionMailer::Base.deliveries.clear end def test_user_create_facebook_failure @@ -594,13 +562,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest end end end - - ActionMailer::Base.deliveries.clear end def test_user_create_facebook_redirect orig_email = "redirect_tester_facebook_orig@osm.org" - verified_email = UsersController.message_hmac(orig_email) + email_hmac = UsersController.message_hmac(orig_email) new_email = "redirect_tester_facebook@osm.org" display_name = "redirect_tester_facebook" auth_uid = "123454321" @@ -617,17 +583,16 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "facebook") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => orig_email, :verified_email => verified_email, + :email => orig_email, :email_hmac => email_hmac, :auth_provider => "facebook", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, - :verified_email => verified_email, + :email_hmac => email_hmac, :display_name => display_name, :auth_provider => "facebook", - :auth_uid => auth_uid, - :consider_pd => "1" } } + :auth_uid => auth_uid } } assert_response :redirect follow_redirect! end @@ -649,8 +614,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_response :success assert_template "confirmations/confirm" - ActionMailer::Base.deliveries.clear - # Go to the confirmation page get "/user/#{display_name}/confirm", :params => { :referer => "/welcome", :confirm_string => confirm_string } assert_response :success @@ -665,7 +628,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest def test_user_create_microsoft_success new_email = "newtester-microsoft@osm.org" - verified_email = UsersController.message_hmac(new_email) + email_hmac = UsersController.message_hmac(new_email) display_name = "new_tester-microsoft" auth_uid = "123454321" @@ -680,16 +643,15 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "microsoft") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => new_email, :verified_email => verified_email, + :email => new_email, :email_hmac => email_hmac, :auth_provider => "microsoft", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, :display_name => display_name, :auth_provider => "microsoft", - :auth_uid => auth_uid, - :consider_pd => "1" }, - :verified_email => verified_email } + :auth_uid => auth_uid }, + :email_hmac => email_hmac } assert_redirected_to welcome_path follow_redirect! end @@ -699,8 +661,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the page assert_response :success assert_template "site/welcome" - - ActionMailer::Base.deliveries.clear end def test_user_create_microsoft_duplicate_email @@ -716,15 +676,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "microsoft") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, :email => dup_user.email, - :verified_email => UsersController.message_hmac(dup_user.email), + :email_hmac => UsersController.message_hmac(dup_user.email), :auth_provider => "microsoft", :auth_uid => auth_uid follow_redirect! assert_response :success assert_template "users/new" assert_select "form > div > input.is-invalid#user_email" - - ActionMailer::Base.deliveries.clear end def test_user_create_microsoft_failure @@ -742,13 +700,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest end end end - - ActionMailer::Base.deliveries.clear end def test_user_create_microsoft_redirect orig_email = "redirect_tester_microsoft_orig@osm.org" - verified_email = UsersController.message_hmac(orig_email) + email_hmac = UsersController.message_hmac(orig_email) new_email = "redirect_tester_microsoft@osm.org" display_name = "redirect_tester_microsoft" auth_uid = "123454321" @@ -764,17 +720,16 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "microsoft") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => orig_email, :verified_email => verified_email, + :email => orig_email, :email_hmac => email_hmac, :auth_provider => "microsoft", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, - :verified_email => verified_email, + :email_hmac => email_hmac, :display_name => display_name, :auth_provider => "microsoft", - :auth_uid => auth_uid, - :consider_pd => "1" } } + :auth_uid => auth_uid } } assert_response :redirect follow_redirect! end @@ -796,8 +751,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_response :success assert_template "confirmations/confirm" - ActionMailer::Base.deliveries.clear - # Go to the confirmation page get "/user/#{display_name}/confirm", :params => { :referer => "/welcome", :confirm_string => confirm_string } assert_response :success @@ -812,7 +765,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest def test_user_create_github_success new_email = "newtester-github@osm.org" - verified_email = UsersController.message_hmac(new_email) + email_hmac = UsersController.message_hmac(new_email) display_name = "new_tester-github" password = "testtest" auth_uid = "123454321" @@ -828,11 +781,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "github") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => new_email, :verified_email => verified_email, + :email => new_email, :email_hmac => email_hmac, :auth_provider => "github", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, :display_name => display_name, :auth_provider => "github", @@ -841,7 +794,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest :pass_crypt_confirmation => password }, :read_ct => 1, :read_tou => 1, - :verified_email => verified_email } + :email_hmac => email_hmac } assert_redirected_to welcome_path follow_redirect! end @@ -851,8 +804,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest # Check the page assert_response :success assert_template "site/welcome" - - ActionMailer::Base.deliveries.clear end def test_user_create_github_duplicate_email @@ -869,15 +820,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "github") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => dup_user.email, :verified_email => UsersController.message_hmac(dup_user.email), + :email => dup_user.email, :email_hmac => UsersController.message_hmac(dup_user.email), :auth_provider => "github", :auth_uid => auth_uid follow_redirect! assert_response :success assert_template "users/new" assert_select "form > div > input.is-invalid#user_email" - - ActionMailer::Base.deliveries.clear end def test_user_create_github_failure @@ -894,13 +843,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest end end end - - ActionMailer::Base.deliveries.clear end def test_user_create_github_redirect orig_email = "redirect_tester_github_orig@osm.org" - verified_email = UsersController.message_hmac(orig_email) + email_hmac = UsersController.message_hmac(orig_email) new_email = "redirect_tester_github@osm.org" display_name = "redirect_tester_github" auth_uid = "123454321" @@ -916,16 +863,15 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "github") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => orig_email, :verified_email => verified_email, + :email => orig_email, :email_hmac => email_hmac, :auth_provider => "github", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, - :verified_email => verified_email, + :email_hmac => email_hmac, :display_name => display_name, :auth_provider => "github", - :auth_uid => auth_uid, - :consider_pd => "1" } } + :auth_uid => auth_uid } } assert_response :redirect follow_redirect! end @@ -947,8 +893,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_response :success assert_template "confirmations/confirm" - ActionMailer::Base.deliveries.clear - # Go to the confirmation page get "/user/#{display_name}/confirm", :params => { :referer => "/welcome", :confirm_string => confirm_string } assert_response :success @@ -963,7 +907,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest def test_user_create_wikipedia_success new_email = "newtester-wikipedia@osm.org" - verified_email = UsersController.message_hmac(new_email) + email_hmac = UsersController.message_hmac(new_email) display_name = "new_tester-wikipedia" password = "testtest" auth_uid = "123454321" @@ -979,10 +923,10 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => new_email, :verified_email => verified_email, + :email => new_email, :email_hmac => email_hmac, :auth_provider => "wikipedia", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, :display_name => display_name, :auth_provider => "wikipedia", @@ -991,7 +935,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest :pass_crypt_confirmation => password }, :read_ct => 1, :read_tou => 1, - :verified_email => verified_email } + :email_hmac => email_hmac } assert_redirected_to welcome_path follow_redirect! end @@ -1016,15 +960,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => dup_user.email, :verified_email => UsersController.message_hmac(dup_user.email), + :email => dup_user.email, :email_hmac => UsersController.message_hmac(dup_user.email), :auth_provider => "wikipedia", :auth_uid => auth_uid follow_redirect! assert_response :success assert_template "users/new" assert_select "form > div > input.is-invalid#user_email" - - ActionMailer::Base.deliveries.clear end def test_user_create_wikipedia_failure @@ -1042,13 +984,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest end end end - - ActionMailer::Base.deliveries.clear end def test_user_create_wikipedia_redirect orig_email = "redirect_tester_wikipedia_orig@osm.org" - verified_email = UsersController.message_hmac(orig_email) + email_hmac = UsersController.message_hmac(orig_email) new_email = "redirect_tester_wikipedia@osm.org" display_name = "redirect_tester_wikipedia" auth_uid = "123454321" @@ -1065,17 +1005,16 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/user/new") follow_redirect! assert_redirected_to :controller => :users, :action => "new", :nickname => display_name, - :email => orig_email, :verified_email => verified_email, + :email => orig_email, :email_hmac => email_hmac, :auth_provider => "wikipedia", :auth_uid => auth_uid follow_redirect! - post "/user/new", + post "/user", :params => { :user => { :email => new_email, - :verified_email => verified_email, + :email_hmac => email_hmac, :display_name => display_name, :auth_provider => "wikipedia", - :auth_uid => auth_uid, - :consider_pd => "1" } } + :auth_uid => auth_uid } } assert_response :redirect follow_redirect! end @@ -1097,8 +1036,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest assert_response :success assert_template "confirmations/confirm" - ActionMailer::Base.deliveries.clear - # Go to the confirmation page get "/user/#{display_name}/confirm", :params => { :referer => "/welcome", :confirm_string => confirm_string } assert_response :success