X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/32f86316712b8b781dfc2ffde0a5b88b742a6627..ef820ade46f6df029bc4453769e20de7976525cb:/test/integration/user_roles_test.rb diff --git a/test/integration/user_roles_test.rb b/test/integration/user_roles_test.rb index df8b1561f..17531ef3f 100644 --- a/test/integration/user_roles_test.rb +++ b/test/integration/user_roles_test.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../test_helper' -class UserRolesControllerTest < ActionController::IntegrationTest +class UserRolesTest < ActionController::IntegrationTest fixtures :users, :user_roles test "grant" do @@ -17,7 +17,12 @@ class UserRolesControllerTest < ActionController::IntegrationTest end def check_fail(action, user, role) - post '/login', {'user[email]' => users(user).email, 'user[password]' => "test", :referer => "/"} + get '/login' + assert_response :redirect + assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true" + follow_redirect! + assert_response :success + post '/login', {'username' => users(user).email, 'password' => "test", :referer => "/"} assert_response :redirect follow_redirect! assert_response :success @@ -30,7 +35,12 @@ class UserRolesControllerTest < ActionController::IntegrationTest end def check_success(action, user, role) - post '/login', {'user[email]' => users(user).email, 'user[password]' => "test", :referer => "/"} + get '/login' + assert_response :redirect + assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true" + follow_redirect! + assert_response :success + post '/login', {'username' => users(user).email, 'password' => "test", :referer => "/"} assert_response :redirect follow_redirect! assert_response :success