Test rows inside messages table body

This commit is contained in:
Anton Khorev 2024-04-15 03:51:43 +03:00
parent 0547bda93f
commit ea47f9bc68

View file

@ -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