4 class OutboxesControllerTest < ActionDispatch::IntegrationTest
6 # test all routes which lead to this controller
9 { :path => "/messages/outbox", :method => :get },
10 { :controller => "messages/outboxes", :action => "show" }
16 message = create(:message, :sender => user)
20 get messages_outbox_path
21 assert_response :success
22 assert_select ".content-inner > table.messages-table > tbody", :count => 1 do
23 assert_select "tr", :count => 1
24 assert_select "tr#outbox-#{message.id}", :count => 1 do
25 assert_select "a[href='#{user_path message.recipient}']", :text => message.recipient.display_name
26 assert_select "a[href='#{message_path message}']", :text => message.title
31 def test_show_requires_login
32 get messages_outbox_path
33 assert_redirected_to login_path(:referer => messages_outbox_path)