]> git.openstreetmap.org Git - rails.git/blobdiff - test/integration/user_creation_test.rb
Merge remote-tracking branch 'openstreetmap/pull/1174'
[rails.git] / test / integration / user_creation_test.rb
index 940eb30445b422c1538be83f3e7dae08f09ad653..2bc17f711f7b2324049dff09b2318849c666299e 100644 (file)
@@ -40,7 +40,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       end
       assert_response :success
       assert_template "user/new"
-      assert_equal response.headers["Content-Language"][0..1], locale.to_s[0..1] unless locale == :root
+      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_no_missing_translations
     end
@@ -81,7 +81,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
       assert_difference("User.count") do
         assert_difference("ActionMailer::Base.deliveries.size", 1) do
           post_via_redirect "/user/save", {},
-                            { "HTTP_ACCEPT_LANGUAGE" => "#{locale}" }
+                            { "HTTP_ACCEPT_LANGUAGE" => locale.to_s }
         end
       end
 
@@ -385,9 +385,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
   end
 
   def test_user_create_facebook_success
-    OmniAuth.config.add_mock(:facebook, :uid => "123454321", :extra => {
-                               :id_info => { "openid_id" => "http://localhost:1123/new.tester" }
-                             })
+    OmniAuth.config.add_mock(:facebook, :uid => "123454321")
 
     new_email = "newtester-facebook@osm.org"
     display_name = "new_tester-facebook"
@@ -447,9 +445,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
   end
 
   def test_user_create_facebook_redirect
-    OmniAuth.config.add_mock(:facebook, :uid => "123454321", :extra => {
-                               :id_info => { "openid_id" => "http://localhost:1123/new.tester" }
-                             })
+    OmniAuth.config.add_mock(:facebook, :uid => "123454321")
 
     new_email = "redirect_tester_facebook@osm.org"
     display_name = "redirect_tester_facebook"
@@ -502,9 +498,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
   end
 
   def test_user_create_windowslive_success
-    OmniAuth.config.add_mock(:windowslive, :uid => "123454321", :extra => {
-                               :id_info => { "openid_id" => "http://localhost:1123/new.tester" }
-                             })
+    OmniAuth.config.add_mock(:windowslive, :uid => "123454321")
 
     new_email = "newtester-windowslive@osm.org"
     display_name = "new_tester-windowslive"
@@ -517,7 +511,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
         assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
         follow_redirect!
         assert_response :redirect
-        assert_redirected_to auth_success_path(:provider => "windowslive")
+        assert_redirected_to auth_success_path(:provider => "windowslive", :origin => "/user/new")
         follow_redirect!
         assert_response :redirect
         assert_redirected_to "/user/terms"
@@ -548,7 +542,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
         assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
         follow_redirect!
         assert_response :redirect
-        assert_redirected_to auth_success_path(:provider => "windowslive")
+        assert_redirected_to auth_success_path(:provider => "windowslive", :origin => "/user/new")
         follow_redirect!
         assert_response :redirect
         assert_redirected_to auth_failure_path(:strategy => "windowslive", :message => "connection_failed", :origin => "/user/new")
@@ -564,9 +558,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
   end
 
   def test_user_create_windowslive_redirect
-    OmniAuth.config.add_mock(:windowslive, :uid => "123454321", :extra => {
-                               :id_info => { "openid_id" => "http://localhost:1123/new.tester" }
-                             })
+    OmniAuth.config.add_mock(:windowslive, :uid => "123454321")
 
     new_email = "redirect_tester_windowslive@osm.org"
     display_name = "redirect_tester_windowslive"
@@ -580,7 +572,7 @@ class UserCreationTest < ActionDispatch::IntegrationTest
         assert_redirected_to auth_path(:provider => "windowslive", :origin => "/user/new")
         follow_redirect!
         assert_response :redirect
-        assert_redirected_to auth_success_path(:provider => "windowslive")
+        assert_redirected_to auth_success_path(:provider => "windowslive", :origin => "/user/new")
         follow_redirect!
         assert_response :redirect
         assert_redirected_to "/user/terms"