- # Check that the marking a message unread via XHR works
- post :mark, :xhr => true, :params => { :message_id => unread_message.id, :mark => "unread" }
- assert_response :success
- assert_template "mark"
- assert_equal false, Message.find(unread_message.id).message_read
-
- # Asking to mark a message with no ID should fail
- assert_raise ActionController::UrlGenerationError do
- post :mark
- end
+ # Check that the marking a message unread works and redirects to inbox from the message page
+ post message_mark_path(message, :mark => "unread"), :headers => { :referer => message_path(message) }
+ assert_redirected_to inbox_messages_path
+ assert_not Message.find(message.id).message_read