From 864054c00504f8107535aacf181ccedf52cb1d0f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 18 Apr 2012 19:30:08 +0000 Subject: [PATCH] Additional test for MyController. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9438 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/my_controller_test.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index 644ecb792..a0c2e2456 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -22,7 +22,7 @@ require 'my_controller' class MyController; def rescue_action(e) raise e end; end class MyControllerTest < ActionController::TestCase - fixtures :users, :user_preferences, :roles, :projects, :issues, :issue_statuses, :trackers, :enumerations, :custom_fields + fixtures :users, :user_preferences, :roles, :projects, :issues, :issue_statuses, :trackers, :enumerations, :custom_fields, :auth_sources def setup @controller = MyController.new @@ -152,6 +152,14 @@ class MyControllerTest < ActionController::TestCase assert User.try_to_login('jsmith', 'hello') end + def test_change_password_should_redirect_if_user_cannot_change_its_password + User.find(2).update_attribute(:auth_source_id, 1) + + get :password + assert_not_nil flash[:error] + assert_redirected_to '/my/account' + end + def test_page_layout get :page_layout assert_response :success -- 2.39.5