]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/accounts_controller_test.rb
Test account destroy route
[rails.git] / test / controllers / accounts_controller_test.rb
index ce8a62242060e295f83892f2852a221415a61519..f13574213a7fdcc5927aebc63f0eb343f32a8692 100644 (file)
@@ -12,6 +12,10 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
       { :path => "/account", :method => :put },
       { :controller => "accounts", :action => "update" }
     )
       { :path => "/account", :method => :put },
       { :controller => "accounts", :action => "update" }
     )
+    assert_routing(
+      { :path => "/account", :method => :delete },
+      { :controller => "accounts", :action => "destroy" }
+    )
   end
 
   def test_account
   end
 
   def test_account
@@ -71,8 +75,8 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
     # Changing name to one that doesn't exist should work
     new_attributes = user.attributes.dup.merge(:display_name => "new tester")
     patch account_path, :params => { :user => new_attributes }
     # Changing name to one that doesn't exist should work
     new_attributes = user.attributes.dup.merge(:display_name => "new tester")
     patch account_path, :params => { :user => new_attributes }
-    assert_redirected_to edit_account_url
-    get edit_account_path
+    assert_redirected_to edit_account_path
+    follow_redirect!
     assert_response :success
     assert_template :edit
     assert_select ".alert-success", /^User information updated successfully/
     assert_response :success
     assert_template :edit
     assert_select ".alert-success", /^User information updated successfully/
@@ -112,8 +116,8 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
         patch account_path, :params => { :user => user.attributes }
       end
     end
         patch account_path, :params => { :user => user.attributes }
       end
     end
-    assert_redirected_to edit_account_url
-    get edit_account_path
+    assert_redirected_to edit_account_path
+    follow_redirect!
     assert_response :success
     assert_template :edit
     assert_select ".alert-success", /^User information updated successfully/
     assert_response :success
     assert_template :edit
     assert_select ".alert-success", /^User information updated successfully/