X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/1f8a68371ad34594cce4aadf5fef229588fd4ddc..21855aa355ed66bea0ae21acb3d675aeaccc963b:/test/functional/message_controller_test.rb diff --git a/test/functional/message_controller_test.rb b/test/functional/message_controller_test.rb index 96f509cb0..a2bb1f805 100644 --- a/test/functional/message_controller_test.rb +++ b/test/functional/message_controller_test.rb @@ -2,9 +2,44 @@ 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/reply/1", :method => :post }, + { :controller => "message", :action => "reply", :message_id => "1" } + ) + assert_routing( + { :path => "/message/delete/1", :method => :post }, + { :controller => "message", :action => "delete", :message_id => "1" } + ) end end