]> git.openstreetmap.org Git - rails.git/blobdiff - test/integration/user_roles_test.rb
Seems that the Rails.env doesn't consistently work. Removing condition in config...
[rails.git] / test / integration / user_roles_test.rb
index df8b1561f0083d5aa26dc9a32685b0d43eb146a0..0691edc8ea0e763436cc5ca7e0e218ede1022d66 100644 (file)
@@ -17,6 +17,11 @@ class UserRolesControllerTest < ActionController::IntegrationTest
   end
 
   def check_fail(action, user, role)
+    get '/login'
+    assert_response :redirect
+    assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true"
+    follow_redirect!
+    assert_response :success
     post '/login', {'user[email]' => users(user).email, 'user[password]' => "test", :referer => "/"}
     assert_response :redirect
     follow_redirect!
@@ -30,6 +35,11 @@ class UserRolesControllerTest < ActionController::IntegrationTest
   end
 
   def check_success(action, user, role)
+    get '/login'
+    assert_response :redirect
+    assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true"
+    follow_redirect!
+    assert_response :success
     post '/login', {'user[email]' => users(user).email, 'user[password]' => "test", :referer => "/"}
     assert_response :redirect
     follow_redirect!