X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/427becc1db048c05576887e74b26c4118fa32d77..90e46a58de583ac2bd7bb43077faa94186957a7a:/test/functional/message_controller_test.rb diff --git a/test/functional/message_controller_test.rb b/test/functional/message_controller_test.rb index 96f509cb0..1a47f02d6 100644 --- a/test/functional/message_controller_test.rb +++ b/test/functional/message_controller_test.rb @@ -2,9 +2,40 @@ require File.dirname(__FILE__) + '/../test_helper' require 'message_controller' class MessageControllerTest < ActionController::TestCase - - # Replace this with your real tests. - def test_truth - assert true + ## + # test all routes which lead to this controller + def test_routes + assert_routing( + { :path => "/user/username/inbox", :method => :get }, + { :controller => "message", :action => "inbox", :display_name => "username" } + ) + assert_routing( + { :path => "/user/username/outbox", :method => :get }, + { :controller => "message", :action => "outbox", :display_name => "username" } + ) + assert_routing( + { :path => "/message/new/username", :method => :get }, + { :controller => "message", :action => "new", :display_name => "username" } + ) + assert_routing( + { :path => "/message/new/username", :method => :post }, + { :controller => "message", :action => "new", :display_name => "username" } + ) + assert_routing( + { :path => "/message/read/1", :method => :get }, + { :controller => "message", :action => "read", :message_id => "1" } + ) + assert_routing( + { :path => "/message/mark/1", :method => :post }, + { :controller => "message", :action => "mark", :message_id => "1" } + ) + assert_routing( + { :path => "/message/reply/1", :method => :get }, + { :controller => "message", :action => "reply", :message_id => "1" } + ) + assert_routing( + { :path => "/message/delete/1", :method => :post }, + { :controller => "message", :action => "delete", :message_id => "1" } + ) end end