X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/51af102c00f5dee8211c16f4d2d4705c8098bacc..d16c4667ed61418f0785f82eaad508655c6c6c7a:/test/controllers/users_controller_test.rb diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb index ff75df548..54c737b97 100644 --- a/test/controllers/users_controller_test.rb +++ b/test/controllers/users_controller_test.rb @@ -406,6 +406,25 @@ class UsersControllerTest < ActionDispatch::IntegrationTest ActionMailer::Base.deliveries.clear end + def test_login + user = create(:user) + + get login_path + assert_response :redirect + assert_redirected_to login_path(:cookie_test => true) + follow_redirect! + assert_response :success + assert_template "login" + + get login_path, :params => { :username => user.display_name, :password => "test" } + assert_response :success + assert_template "login" + + post login_path, :params => { :username => user.display_name, :password => "test" } + assert_response :redirect + assert_redirected_to root_path + end + def test_logout_without_referer post logout_path assert_response :redirect