]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/message_controller_test.rb
Merge remote-tracking branch 'upstream/pull/1850'
[rails.git] / test / controllers / message_controller_test.rb
index 8a7ae70de6c34a96f1a92194839819f56a5ccc95..3810c57c3d6713f87a78e360a7655f74de4003aa 100644 (file)
@@ -63,7 +63,7 @@ class MessageControllerTest < ActionController::TestCase
     get :new, :params => { :display_name => recipient_user.display_name }
     assert_response :success
     assert_template "new"
-    assert_select "title", "OpenStreetMap | Send message"
+    assert_select "title", "Send message | OpenStreetMap"
     assert_select "form[action='#{new_message_path(:display_name => recipient_user.display_name)}']", :count => 1 do
       assert_select "input#message_title", :count => 1
       assert_select "textarea#message_body", :count => 1
@@ -89,7 +89,7 @@ class MessageControllerTest < ActionController::TestCase
     end
     assert_response :success
     assert_template "new"
-    assert_select "title", "OpenStreetMap | Send message"
+    assert_select "title", "Send message | OpenStreetMap"
     assert_select "form[action='#{new_message_path(:display_name => recipient_user.display_name)}']", :count => 1 do
       assert_select "input#message_title", :count => 1 do
         assert_select "[value='Test Message']"
@@ -117,7 +117,7 @@ class MessageControllerTest < ActionController::TestCase
     end
     assert_response :success
     assert_template "new"
-    assert_select "title", "OpenStreetMap | Send message"
+    assert_select "title", "Send message | OpenStreetMap"
     assert_select "form[action='#{new_message_path(:display_name => recipient_user.display_name)}']", :count => 1 do
       assert_select "input#message_title", :count => 1 do
         assert_select "[value='Test Message']"
@@ -145,7 +145,7 @@ class MessageControllerTest < ActionController::TestCase
     end
     assert_response :success
     assert_template "new"
-    assert_select "title", "OpenStreetMap | Send message"
+    assert_select "title", "Send message | OpenStreetMap"
     assert_select "form[action='#{new_message_path(:display_name => recipient_user.display_name)}']", :count => 1 do
       assert_select "input#message_title", :count => 1 do
         assert_select "[value='']"
@@ -178,6 +178,7 @@ class MessageControllerTest < ActionController::TestCase
     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 %r{#{SERVER_URL}/message/read/}, e.text_part.decoded
     ActionMailer::Base.deliveries.clear
     m = Message.last
     assert_equal user.id, m.from_user_id
@@ -244,7 +245,7 @@ class MessageControllerTest < ActionController::TestCase
     get :reply, :params => { :message_id => unread_message.id }
     assert_response :success
     assert_template "new"
-    assert_select "title", "OpenStreetMap | Re: #{unread_message.title}"
+    assert_select "title", "Re: #{unread_message.title} | OpenStreetMap"
     assert_select "form[action='#{new_message_path(:display_name => user.display_name)}']", :count => 1 do
       assert_select "input#message_title[value='Re: #{unread_message.title}']", :count => 1
       assert_select "textarea#message_body", :count => 1