sends a copy of the direct message to the sender

This commit is contained in:
rgarcia
2016-06-14 18:55:28 +02:00
parent fd67294075
commit ce6072d17b
9 changed files with 86 additions and 15 deletions

View File

@@ -214,4 +214,20 @@ module CommonActions
Notification.last
end
def create_direct_message(sender, receiver)
login_as(sender)
visit user_path(receiver)
click_link "Send private message"
expect(page).to have_content "Send private message to #{receiver.name}"
fill_in 'direct_message_title', with: "Hey #{receiver.name}!"
fill_in 'direct_message_body', with: "How are you doing? This is #{sender.name}"
click_button "Send message"
expect(page).to have_content "You message has been sent successfully."
DirectMessage.last
end
end