diff options
Diffstat (limited to 'test/functional/account_controller_test.rb')
-rw-r--r-- | test/functional/account_controller_test.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index 5a11dbaa2..0f9ae8eed 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -80,9 +80,18 @@ class AccountControllerTest < ActionController::TestCase assert_response 302 end - def test_logout + def test_get_logout_should_not_logout @request.session[:user_id] = 2 get :logout + assert_response :success + assert_template 'logout' + + assert_equal 2, @request.session[:user_id] + end + + def test_logout + @request.session[:user_id] = 2 + post :logout assert_redirected_to '/' assert_nil @request.session[:user_id] end @@ -91,7 +100,7 @@ class AccountControllerTest < ActionController::TestCase @controller.expects(:reset_session).once @request.session[:user_id] = 2 - get :logout + post :logout assert_response 302 end |