]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/messages_controller_test.rb
Merge remote-tracking branch 'upstream/pull/2010'
[rails.git] / test / controllers / messages_controller_test.rb
index a5043a3f3b6c8f9c59fffac8fde7f6a738a3f177..0b3a59b395310709e35e7199dc9eccde82edcae9 100644 (file)
@@ -25,15 +25,15 @@ class MessagesControllerTest < ActionController::TestCase
       { :controller => "messages", :action => "show", :id => "1" }
     )
     assert_routing(
-      { :path => "/message/mark/1", :method => :post },
+      { :path => "/messages/1/mark", :method => :post },
       { :controller => "messages", :action => "mark", :message_id => "1" }
     )
     assert_routing(
-      { :path => "/message/reply/1", :method => :get },
+      { :path => "/messages/1/reply", :method => :get },
       { :controller => "messages", :action => "reply", :message_id => "1" }
     )
     assert_routing(
-      { :path => "/message/reply/1", :method => :post },
+      { :path => "/messages/1/reply", :method => :post },
       { :controller => "messages", :action => "reply", :message_id => "1" }
     )
     assert_routing(
@@ -180,8 +180,8 @@ class MessagesControllerTest < ActionController::TestCase
     e = ActionMailer::Base.deliveries.first
     assert_equal [recipient_user.email], e.to
     assert_equal "[OpenStreetMap] Test Message", e.subject
-    assert_match /Test message body/, e.text_part.decoded
-    assert_match /Test message body/, e.html_part.decoded
+    assert_match(/Test message body/, e.text_part.decoded)
+    assert_match(/Test message body/, e.html_part.decoded)
     assert_match %r{#{SERVER_URL}/messages/[0-9]+}, e.text_part.decoded
     ActionMailer::Base.deliveries.clear
     m = Message.last
@@ -195,7 +195,7 @@ class MessagesControllerTest < ActionController::TestCase
     # Asking to send a message with a bogus user name should fail
     get :new, :params => { :display_name => "non_existent_user" }
     assert_response :not_found
-    assert_template "user/no_such_user"
+    assert_template "users/no_such_user"
     assert_select "h1", "The user non_existent_user does not exist"
   end
 
@@ -232,14 +232,14 @@ class MessagesControllerTest < ActionController::TestCase
 
     # Check that the message reply page requires us to login
     get :reply, :params => { :message_id => unread_message.id }
-    assert_redirected_to login_path(:referer => reply_message_path(:message_id => unread_message.id))
+    assert_redirected_to login_path(:referer => message_reply_path(:message_id => unread_message.id))
 
     # Login as the wrong user
     session[:user] = other_user.id
 
     # Check that we can't reply to somebody else's message
     get :reply, :params => { :message_id => unread_message.id }
-    assert_redirected_to login_path(:referer => reply_message_path(:message_id => unread_message.id))
+    assert_redirected_to login_path(:referer => message_reply_path(:message_id => unread_message.id))
     assert_equal "You are logged in as `#{other_user.display_name}' but the message you have asked to reply to was not sent to that user. Please login as the correct user in order to reply.", flash[:notice]
 
     # Login as the right user