diff options
Diffstat (limited to 'test/functional/my_controller_test.rb')
-rw-r--r-- | test/functional/my_controller_test.rb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index b2389c39b..5df2932ed 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -61,29 +61,30 @@ class MyControllerTest < Test::Unit::TestCase end def test_change_password - get :account + get :password assert_response :success - assert_template 'account' + assert_template 'password' # non matching password confirmation - post :change_password, :password => 'jsmith', - :new_password => 'hello', - :new_password_confirmation => 'hello2' + post :password, :password => 'jsmith', + :new_password => 'hello', + :new_password_confirmation => 'hello2' assert_response :success - assert_template 'account' + assert_template 'password' assert_tag :tag => "div", :attributes => { :class => "errorExplanation" } # wrong password - post :change_password, :password => 'wrongpassword', - :new_password => 'hello', - :new_password_confirmation => 'hello' - assert_redirected_to 'my/account' + post :password, :password => 'wrongpassword', + :new_password => 'hello', + :new_password_confirmation => 'hello' + assert_response :success + assert_template 'password' assert_equal 'Wrong password', flash[:error] # good password - post :change_password, :password => 'jsmith', - :new_password => 'hello', - :new_password_confirmation => 'hello' + post :password, :password => 'jsmith', + :new_password => 'hello', + :new_password_confirmation => 'hello' assert_redirected_to 'my/account' assert User.try_to_login('jsmith', 'hello') end |