From 92a88941187db826b1885306698dcc115c6dbce9 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 4 Jul 2013 14:52:41 +0100 Subject: [PATCH 1/1] Fix up user creation tests to handle cookie check --- test/functional/user_controller_test.rb | 6 +++++- test/integration/user_creation_test.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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 -- 2.43.2