X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/59c90aa0235ccba8f5f3a843170286c4e650a91c..7054cea48ee9728c155334b48777a5f25db89af8:/test/controllers/friendships_controller_test.rb diff --git a/test/controllers/friendships_controller_test.rb b/test/controllers/friendships_controller_test.rb index 906756850..6273caaf2 100644 --- a/test/controllers/friendships_controller_test.rb +++ b/test/controllers/friendships_controller_test.rb @@ -6,19 +6,19 @@ class FriendshipsControllerTest < ActionDispatch::IntegrationTest def test_routes assert_routing( { :path => "/user/username/make_friend", :method => :get }, - { :controller => "users", :action => "make_friend", :display_name => "username" } + { :controller => "friendships", :action => "make_friend", :display_name => "username" } ) assert_routing( { :path => "/user/username/make_friend", :method => :post }, - { :controller => "users", :action => "make_friend", :display_name => "username" } + { :controller => "friendships", :action => "make_friend", :display_name => "username" } ) assert_routing( { :path => "/user/username/remove_friend", :method => :get }, - { :controller => "users", :action => "remove_friend", :display_name => "username" } + { :controller => "friendships", :action => "remove_friend", :display_name => "username" } ) assert_routing( { :path => "/user/username/remove_friend", :method => :post }, - { :controller => "users", :action => "remove_friend", :display_name => "username" } + { :controller => "friendships", :action => "remove_friend", :display_name => "username" } ) end @@ -32,7 +32,7 @@ class FriendshipsControllerTest < ActionDispatch::IntegrationTest # When not logged in a GET should ask us to login get make_friend_path(friend) - assert_redirected_to :action => "login", :referer => make_friend_path(:display_name => friend.display_name) + assert_redirected_to login_path(:referer => make_friend_path(:display_name => friend.display_name)) # When not logged in a POST should error post make_friend_path(friend) @@ -110,7 +110,7 @@ class FriendshipsControllerTest < ActionDispatch::IntegrationTest ActionMailer::Base.deliveries.clear end - def test_make_friend_unkown_user + def test_make_friend_unknown_user # Should error when a bogus user is specified session_for(create(:user)) get make_friend_path(:display_name => "No Such User") @@ -129,7 +129,7 @@ class FriendshipsControllerTest < ActionDispatch::IntegrationTest # When not logged in a GET should ask us to login get remove_friend_path(friend) - assert_redirected_to :action => "login", :referer => remove_friend_path(:display_name => friend.display_name) + assert_redirected_to login_path(:referer => remove_friend_path(:display_name => friend.display_name)) # When not logged in a POST should error post remove_friend_path, :params => { :display_name => friend.display_name } @@ -188,7 +188,7 @@ class FriendshipsControllerTest < ActionDispatch::IntegrationTest assert_nil Friendship.where(:befriender => user, :befriendee => friend).first end - def test_remove_friend_unkown_user + def test_remove_friend_unknown_user # Should error when a bogus user is specified session_for(create(:user)) get remove_friend_path(:display_name => "No Such User")