]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/user_controller_test.rb
Update to iD v2.4.1
[rails.git] / test / controllers / user_controller_test.rb
index 3e71ea06a166a4da6d9a2d0de1223b4dbd75f617..1561a9ebe25a88a63584eac99497ca9aed6749f2 100644 (file)
@@ -749,6 +749,12 @@ class UserControllerTest < ActionController::TestCase
     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
@@ -782,6 +788,11 @@ class UserControllerTest < ActionController::TestCase
     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"