assert_response :success
assert_template :reset_password
+ # Test that errors are reported for erroneous submissions
+ post :reset_password, :params => { :token => token.token, :user => { :pass_crypt => "new_password", :pass_crypt_confirmation => "different_password" } }
+ assert_response :success
+ assert_template :reset_password
+ assert_select "div#errorExplanation"
+
# Test setting a new password
post :reset_password, :params => { :token => token.token, :user => { :pass_crypt => "new_password", :pass_crypt_confirmation => "new_password" } }
assert_response :redirect
get :account, :params => { :display_name => user.display_name }, :session => { :user => user }
assert_response :success
assert_template :account
+ assert_select "form#accountForm" do |form|
+ assert_equal "post", form.attr("method").to_s
+ assert_select "input[name='_method']", false
+ assert_equal "/user/#{URI.encode(user.display_name)}/account", form.attr("action").to_s
+ end
# Updating the description should work
user.description = "new description"