]> git.openstreetmap.org Git - rails.git/commitdiff
Fix up user creation tests to handle cookie check
authorTom Hughes <tom@compton.nu>
Thu, 4 Jul 2013 13:52:41 +0000 (14:52 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 4 Jul 2013 13:52:41 +0000 (14:52 +0100)
test/functional/user_controller_test.rb
test/integration/user_creation_test.rb

index 17642b14998ebe1cc24f920c65e09c906fe2a55f..578f477f6993777cf12eab2464706eb109b5b439 100644 (file)
@@ -190,8 +190,12 @@ class UserControllerTest < ActionController::TestCase
   # The user creation page loads
   def test_user_create_view
     get :new
   # The user creation page loads
   def test_user_create_view
     get :new
+    assert_response :redirect
+    assert_redirected_to user_new_path(:cookie_test => "true")
+
+    get :new, { :cookie_test => "true" }, { :cookie_test => true }
     assert_response :success
     assert_response :success
-    
+
     assert_select "html", :count => 1 do
       assert_select "head", :count => 1 do
         assert_select "title", :text => /Create account/, :count => 1
     assert_select "html", :count => 1 do
       assert_select "head", :count => 1 do
         assert_select "title", :text => /Create account/, :count => 1
index 7f3e921f9f180d4b8bed02d936021aa0ebebb56c..67fbea7ec5d6055e68e41cafa56f4d4231adcf75 100644 (file)
@@ -9,7 +9,7 @@ class UserCreationTest < ActionController::IntegrationTest
 
   def test_create_user_form
     I18n.available_locales.each do |locale|
 
   def test_create_user_form
     I18n.available_locales.each do |locale|
-      get '/user/new', {}, {"HTTP_ACCEPT_LANGUAGE" => locale.to_s}
+      get_via_redirect '/user/new', {}, {"HTTP_ACCEPT_LANGUAGE" => locale.to_s}
       assert_response :success
       assert_template 'user/new'
     end
       assert_response :success
       assert_template 'user/new'
     end