Fixup make_friend and remove_friend properly

Requests using POST are now actioned immediately, while requests
using GET present a confirmation page.
This commit is contained in:
Tom Hughes 2012-08-15 19:48:06 +01:00
parent a8396f8871
commit 573991e5a9
8 changed files with 73 additions and 39 deletions

View file

@ -139,10 +139,18 @@ class UserControllerTest < ActionController::TestCase
{ :controller => "user", :action => "account", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/make_friend", :method => :get },
{ :controller => "user", :action => "make_friend", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/make_friend", :method => :post },
{ :controller => "user", :action => "make_friend", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/remove_friend", :method => :get },
{ :controller => "user", :action => "remove_friend", :display_name => "username" }
)
assert_routing(
{ :path => "/user/username/remove_friend", :method => :post },
{ :controller => "user", :action => "remove_friend", :display_name => "username" }