X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e0d0b68785bd1a765b796a826eeeb2782f841ada..7e7ede890e8e948236d3dbc48e24aca00cd01f62:/test/controllers/sessions_controller_test.rb?ds=sidebyside 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