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