From 1cdf6c8b8eaa79c6abcf0910eba342f7c2505513 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Sat, 25 Aug 2012 17:18:22 +0200 Subject: [PATCH] fix #1325 by applying the patch of Dan Rice. Thanks Dan! Also add a test to catch regessions --- lib/login_system.rb | 2 +- test/functional/login_controller_test.rb | 2 +- test/functional/todos_controller_test.rb | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/login_system.rb b/lib/login_system.rb index ec2d911a..10a0accc 100644 --- a/lib/login_system.rb +++ b/lib/login_system.rb @@ -158,7 +158,7 @@ module LoginSystem def access_denied respond_to do |format| format.html { redirect_to login_path } - format.m { redirect_to formatted_login_path(:format => 'm') } + format.m { redirect_to login_path(:format => 'm') } format.js { render :partial => 'login/redirect_to_login' } format.xml { basic_auth_denied } format.rss { basic_auth_denied } diff --git a/test/functional/login_controller_test.rb b/test/functional/login_controller_test.rb index fcacddea..8f32132f 100644 --- a/test/functional/login_controller_test.rb +++ b/test/functional/login_controller_test.rb @@ -45,7 +45,7 @@ class LoginControllerTest < ActionController::TestCase get :login assert_redirected_to signup_url end - + def test_logout login_as :admin_user get :logout diff --git a/test/functional/todos_controller_test.rb b/test/functional/todos_controller_test.rb index ec36eb76..bd1cdd64 100644 --- a/test/functional/todos_controller_test.rb +++ b/test/functional/todos_controller_test.rb @@ -535,6 +535,11 @@ class TodosControllerTest < ActionController::TestCase assert_equal 11, assigns['down_count'] end + def test_mobile_redirect_to_login + get :index, { :format => "m" } + assert_redirected_to login_url(:format => "m") + end + ############### # mobile create ###############