X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c7cc05c078b540641b6c8bac51f218807a83a914..ea47f9bc68652ffe10cf7b39c72b1009080c0d7c:/test/controllers/messages_controller_test.rb diff --git a/test/controllers/messages_controller_test.rb b/test/controllers/messages_controller_test.rb index df7146ad6..5ef0233bf 100644 --- a/test/controllers/messages_controller_test.rb +++ b/test/controllers/messages_controller_test.rb @@ -339,8 +339,8 @@ class MessagesControllerTest < ActionDispatch::IntegrationTest get inbox_messages_path assert_response :success assert_template "inbox" - assert_select ".content-inner > table", :count => 1 do - assert_select "tr", :count => 2 + assert_select ".content-inner > table.messages-table > tbody", :count => 1 do + assert_select "tr", :count => 1 assert_select "tr#inbox-#{read_message.id}.inbox-row", :count => 1 do assert_select "a[href='#{user_path read_message.sender}']", :text => read_message.sender.display_name assert_select "a[href='#{message_path read_message}']", :text => read_message.title @@ -365,8 +365,8 @@ class MessagesControllerTest < ActionDispatch::IntegrationTest get outbox_messages_path assert_response :success assert_template "outbox" - assert_select ".content-inner > table", :count => 1 do - assert_select "tr", :count => 2 + assert_select ".content-inner > table.messages-table > tbody", :count => 1 do + assert_select "tr", :count => 1 assert_select "tr.inbox-row", :count => 1 do assert_select "a[href='#{user_path message.recipient}']", :text => message.recipient.display_name assert_select "a[href='#{message_path message}']", :text => message.title @@ -408,15 +408,13 @@ class MessagesControllerTest < ActionDispatch::IntegrationTest assert_not Message.find(unread_message.id).message_read # Check that the marking a message read via XHR works - post message_mark_path(:message_id => unread_message, :mark => "read"), :xhr => true - assert_response :success - assert_template "mark" + post message_mark_path(:message_id => unread_message, :mark => "read") + assert_response :see_other assert Message.find(unread_message.id).message_read # Check that the marking a message unread via XHR works - post message_mark_path(:message_id => unread_message, :mark => "unread"), :xhr => true - assert_response :success - assert_template "mark" + post message_mark_path(:message_id => unread_message, :mark => "unread") + assert_response :see_other assert_not Message.find(unread_message.id).message_read # Asking to mark a message with no ID should fail