sends a copy of the direct message to the sender
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user