X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ad4ab4603b27f2e89e4bb4a709bc04a6685ba67b..53a33110f0bb7440ab7ec5b00b59c9fc768f7de4:/test/controllers/sessions_controller_test.rb diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb index 914a4ab56..f490b748c 100644 --- a/test/controllers/sessions_controller_test.rb +++ b/test/controllers/sessions_controller_test.rb @@ -54,6 +54,24 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest assert_redirected_to root_path end + def test_login_remembered + user = create(:user) + + post login_path, :params => { :username => user.display_name, :password => "test", :remember_me => "yes" } + assert_redirected_to root_path + + assert_equal 28 * 86400, session[:_remember_for] + end + + def test_login_not_remembered + user = create(:user) + + post login_path, :params => { :username => user.display_name, :password => "test", :remember_me => "0" } + assert_redirected_to root_path + + assert_nil session[:_remember_for] + end + def test_logout_without_referer post logout_path assert_redirected_to root_path