]> git.openstreetmap.org Git - rails.git/blobdiff - test/integration/user_creation_test.rb
Improve locale selection algorithm
[rails.git] / test / integration / user_creation_test.rb
index e344b5879b744bc2c3d1552d1bed809882ebc277..9c934dc072282f8c8ac590435d34d546d652662c 100644 (file)
@@ -7,9 +7,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest
     OmniAuth.config.test_mode = true
 
     stub_request(:get, /.*gravatar.com.*d=404/).to_return(:status => 404)
-    stub_request(:get, "https://api.hostip.info/country.php?ip=127.0.0.1").
-      to_return(status: 200, body: "", headers: {})
-
   end
 
   def teardown
@@ -35,22 +32,26 @@ class UserCreationTest < ActionDispatch::IntegrationTest
   end
 
   def test_user_create_submit_duplicate_email
-    I18n.available_locales.each do |locale|
+    Locale.available.each do |locale|
       dup_email = create(:user).email
       display_name = "#{locale}_new_tester"
       assert_difference("User.count", 0) do
         assert_difference("ActionMailer::Base.deliveries.size", 0) do
           perform_enqueued_jobs do
             post "/user/new",
-                 :params => { :user => { :email => dup_email, :email_confirmation => dup_email, :display_name => display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } },
+                 :params => { :user => { :email => dup_email,
+                                         :email_confirmation => dup_email,
+                                         :display_name => display_name,
+                                         :pass_crypt => "testtest",
+                                         :pass_crypt_confirmation => "testtest" } },
                  :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
           end
         end
       end
       assert_response :success
       assert_template "users/new"
-      assert_equal locale.to_s, response.headers["Content-Language"] unless locale == :root
-      assert_select "form > fieldset > div.form-row > input.field_with_errors#user_email"
+      assert_equal locale.to_s, response.headers["Content-Language"]
+      assert_select "form > fieldset > div.standard-form-row > input.field_with_errors#user_email"
       assert_no_missing_translations
     end
   end
@@ -63,14 +64,18 @@ class UserCreationTest < ActionDispatch::IntegrationTest
         assert_difference("ActionMailer::Base.deliveries.size", 0) do
           perform_enqueued_jobs do
             post "/user/new",
-                 :params => { :user => { :email => email, :email_confirmation => email, :display_name => dup_display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } },
+                 :params => { :user => { :email => email,
+                                         :email_confirmation => email,
+                                         :display_name => dup_display_name,
+                                         :pass_crypt => "testtest",
+                                         :pass_crypt_confirmation => "testtest" } },
                  :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
           end
         end
       end
       assert_response :success
       assert_template "users/new"
-      assert_select "form > fieldset > div.form-row > input.field_with_errors#user_display_name"
+      assert_select "form > fieldset > div.standard-form-row > input.field_with_errors#user_display_name"
       assert_no_missing_translations
     end
   end
@@ -84,7 +89,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest
         assert_difference("ActionMailer::Base.deliveries.size", 0) do
           perform_enqueued_jobs do
             post "/user/new",
-                 :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } }
+                 :params => { :user => { :email => new_email,
+                                         :email_confirmation => new_email,
+                                         :display_name => display_name,
+                                         :pass_crypt => "testtest",
+                                         :pass_crypt_confirmation => "testtest" } }
           end
         end
       end
@@ -96,7 +105,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           perform_enqueued_jobs do
             post "/user/save",
                  :headers => { "HTTP_ACCEPT_LANGUAGE" => locale.to_s },
-                 :params => { :read_tou => 1 }
+                 :params => { :read_ct => 1, :read_tou => 1 }
             follow_redirect!
           end
         end
@@ -126,7 +135,11 @@ class UserCreationTest < ActionDispatch::IntegrationTest
         assert_difference("ActionMailer::Base.deliveries.size", 0) do
           perform_enqueued_jobs do
             post "/user/new",
-                 :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" } }
+                 :params => { :user => { :email => new_email,
+                                         :email_confirmation => new_email,
+                                         :display_name => display_name,
+                                         :pass_crypt => "testtest",
+                                         :pass_crypt_confirmation => "testtest" } }
           end
         end
       end
@@ -143,7 +156,6 @@ class UserCreationTest < ActionDispatch::IntegrationTest
     end
   end
 
-
   # Check that the user can successfully recover their password
   def lost_password_recovery_success
     # Open the lost password form
@@ -163,10 +175,20 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :pass_crypt => password, :pass_crypt_confirmation => password }, :referer => referer }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :pass_crypt => password,
+                                       :pass_crypt_confirmation => password },
+                            :referer => referer }
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :pass_crypt => password, :pass_crypt_confirmation => password }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :pass_crypt => password,
+                                       :pass_crypt_confirmation => password },
+                            :read_ct => 1, :read_tou => 1 }
           follow_redirect!
         end
       end
@@ -211,7 +233,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "openid", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "openid",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
           follow_redirect!
@@ -221,7 +249,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "openid", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => password, :pass_crypt_confirmation => password }, :read_tou => 1}
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "openid",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => password,
+                                       :pass_crypt_confirmation => password },
+                            :read_ct => 1, :read_tou => 1 }
           assert_response :redirect
           follow_redirect!
         end
@@ -244,7 +279,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 0) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "openid", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "openid",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
           follow_redirect!
@@ -276,7 +317,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "openid", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "openid",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" },
+                            :referer => referer }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/new.tester", :origin => "/user/new")
           follow_redirect!
@@ -286,7 +334,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "openid", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "openid",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => "testtest",
+                                       :pass_crypt_confirmation => "testtest" },
+                            :read_ct => 1, :read_tou => 1 }
           follow_redirect!
         end
       end
@@ -333,7 +388,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "google",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
           follow_redirect!
@@ -343,7 +403,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :auth_uid => "123454321", :pass_crypt => password, :pass_crypt_confirmation => password }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "google",
+                                       :auth_uid => "123454321",
+                                       :pass_crypt => password,
+                                       :pass_crypt_confirmation => password },
+                            :read_ct => 1, :read_tou => 1 }
           assert_response :redirect
           follow_redirect!
         end
@@ -366,7 +433,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 0) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "google",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
           follow_redirect!
@@ -400,7 +472,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "google",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" },
+                            :referer => referer }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "google", :origin => "/user/new")
           follow_redirect!
@@ -410,7 +488,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "google", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "google",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => "testtest",
+                                       :pass_crypt_confirmation => "testtest" },
+                            :read_ct => 1, :read_tou => 1 }
           follow_redirect!
         end
       end
@@ -455,7 +540,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "facebook",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
           follow_redirect!
@@ -465,7 +555,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :auth_uid => "123454321", :pass_crypt => password, :pass_crypt_confirmation => password }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "facebook",
+                                       :auth_uid => "123454321",
+                                       :pass_crypt => password,
+                                       :pass_crypt_confirmation => password },
+                            :read_ct => 1, :read_tou => 1 }
           assert_response :redirect
           follow_redirect!
         end
@@ -488,7 +585,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 0) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "facebook",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
           follow_redirect!
@@ -520,7 +622,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "facebook",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" },
+                            :referer => referer }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "facebook", :origin => "/user/new")
           follow_redirect!
@@ -530,7 +638,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "facebook", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "facebook",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => "testtest",
+                                       :pass_crypt_confirmation => "testtest" },
+                            :read_ct => 1, :read_tou => 1 }
           follow_redirect!
         end
       end
@@ -575,7 +690,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "windowslive",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
           follow_redirect!
@@ -585,7 +705,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :auth_uid => "123454321", :pass_crypt => password, :pass_crypt_confirmation => password }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "windowslive",
+                                       :auth_uid => "123454321",
+                                       :pass_crypt => password,
+                                       :pass_crypt_confirmation => password },
+                            :read_ct => 1, :read_tou => 1 }
           assert_response :redirect
           follow_redirect!
         end
@@ -608,7 +735,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 0) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "windowslive",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
           follow_redirect!
@@ -640,7 +772,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "windowslive",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" },
+                            :referer => referer }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
           follow_redirect!
@@ -650,7 +788,14 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "windowslive", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "windowslive",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => "testtest",
+                                       :pass_crypt_confirmation => "testtest" },
+                            :read_ct => 1, :read_tou => 1 }
           follow_redirect!
         end
       end
@@ -695,7 +840,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "github",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
           follow_redirect!
@@ -705,7 +855,15 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :auth_uid => "123454321", :pass_crypt => password, :pass_crypt_confirmation => password }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "github",
+                                       :auth_uid => "123454321",
+                                       :pass_crypt => password,
+                                       :pass_crypt_confirmation => password },
+                            :read_ct => 1,
+                            :read_tou => 1 }
           assert_response :redirect
           follow_redirect!
         end
@@ -728,7 +886,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 0) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "github",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
           follow_redirect!
@@ -760,7 +923,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "github",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" },
+                            :referer => referer }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "github", :origin => "/user/new")
           follow_redirect!
@@ -770,7 +939,15 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "github", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "github",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => "testtest",
+                                       :pass_crypt_confirmation => "testtest" },
+                            :read_ct => 1,
+                            :read_tou => 1 }
           follow_redirect!
         end
       end
@@ -815,7 +992,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "wikipedia",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
           follow_redirect!
@@ -825,7 +1007,15 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :auth_uid => "123454321", :pass_crypt => password, :pass_crypt_confirmation => password }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "wikipedia",
+                                       :auth_uid => "123454321",
+                                       :pass_crypt => password,
+                                       :pass_crypt_confirmation => password },
+                            :read_ct => 1,
+                            :read_tou => 1 }
           assert_response :redirect
           follow_redirect!
         end
@@ -848,7 +1038,12 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 0) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :pass_crypt => "", :pass_crypt_confirmation => "" } }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "wikipedia",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" } }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
           follow_redirect!
@@ -880,7 +1075,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("ActionMailer::Base.deliveries.size", 1) do
         perform_enqueued_jobs do
           post "/user/new",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :pass_crypt => "", :pass_crypt_confirmation => "" }, :referer => referer }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "wikipedia",
+                                       :pass_crypt => "",
+                                       :pass_crypt_confirmation => "" },
+                            :referer => referer }
           assert_response :redirect
           assert_redirected_to auth_path(:provider => "wikipedia", :origin => "/user/new")
           follow_redirect!
@@ -890,7 +1091,15 @@ class UserCreationTest < ActionDispatch::IntegrationTest
           assert_response :redirect
           assert_redirected_to "/user/terms"
           post "/user/save",
-               :params => { :user => { :email => new_email, :email_confirmation => new_email, :display_name => display_name, :auth_provider => "wikipedia", :auth_uid => "http://localhost:1123/new.tester", :pass_crypt => "testtest", :pass_crypt_confirmation => "testtest" }, :read_tou => 1 }
+               :params => { :user => { :email => new_email,
+                                       :email_confirmation => new_email,
+                                       :display_name => display_name,
+                                       :auth_provider => "wikipedia",
+                                       :auth_uid => "http://localhost:1123/new.tester",
+                                       :pass_crypt => "testtest",
+                                       :pass_crypt_confirmation => "testtest" },
+                            :read_ct => 1,
+                            :read_tou => 1 }
           follow_redirect!
         end
       end