From: Tom Hughes Date: Thu, 4 Jul 2013 13:52:41 +0000 (+0100) Subject: Fix up user creation tests to handle cookie check X-Git-Tag: live~4935 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/92a88941187db826b1885306698dcc115c6dbce9?hp=e5e6db8d0ea6884bddf7fe75280e32faa4725d3a;ds=sidebyside Fix up user creation tests to handle cookie check --- diff --git a/test/functional/user_controller_test.rb b/test/functional/user_controller_test.rb index 17642b149..578f477f6 100644 --- a/test/functional/user_controller_test.rb +++ b/test/functional/user_controller_test.rb @@ -190,8 +190,12 @@ class UserControllerTest < ActionController::TestCase # 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_select "html", :count => 1 do assert_select "head", :count => 1 do assert_select "title", :text => /Create account/, :count => 1 diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb index 7f3e921f9..67fbea7ec 100644 --- a/test/integration/user_creation_test.rb +++ b/test/integration/user_creation_test.rb @@ -9,7 +9,7 @@ class UserCreationTest < ActionController::IntegrationTest 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