X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c8ee1351049ef1bb4d7b50d071b2a96154266d1d..561f2f694adc8ac57011eac1eec5929425276c59:/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