X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e0d0b68785bd1a765b796a826eeeb2782f841ada..326d4ecec0ca0817567912f5d45b904df4c5b054:/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