|
@@ -11,4 +11,12 @@ class ConversationsControllerTest < ActionDispatch::IntegrationTest
|
|
|
get conversation_path conversations(:two)
|
|
|
assert_redirected_to root_path
|
|
|
end
|
|
|
+
|
|
|
+ test "last message should be shown in index" do
|
|
|
+ message = @user.messages.build(content: "Hello, world!",
|
|
|
+ conversation: conversations(:one))
|
|
|
+ message.save
|
|
|
+ get conversations_path
|
|
|
+ assert_match message.content, response.body
|
|
|
+ end
|
|
|
end
|