- # 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"
- 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"
- assert_not Message.find(unread_message.id).message_read
+ # Check that the marking a message read works and redirects to inbox from the message page
+ post message_mark_path(message, :mark => "read"), :headers => { :referer => message_path(message) }
+ assert_redirected_to inbox_messages_path
+ assert Message.find(message.id).message_read