Make and use a single cucumber step to send a private message
This commit is contained in:
parent
9c99331bb7
commit
48282e3402
2 changed files with 13 additions and 10 deletions
|
|
@ -10,17 +10,8 @@ Feature: private messages
|
||||||
When I sign in as "bob@bob.bob"
|
When I sign in as "bob@bob.bob"
|
||||||
And a user with username "bob" is connected with "Alice_Awesome"
|
And a user with username "bob" is connected with "Alice_Awesome"
|
||||||
|
|
||||||
And I am on the conversations page
|
|
||||||
|
|
||||||
Scenario: send a message
|
Scenario: send a message
|
||||||
Given I follow "New Message"
|
Given I send a message with subject "Greetings" and text "hello, alice!" to "Alice Awesome"
|
||||||
And I wait for the ajax to finish
|
|
||||||
And I fill in "contact_autocomplete" with "Alice" in the modal window
|
|
||||||
And I press the first ".as-result-item" within ".as-results" in the modal window
|
|
||||||
And I fill in "conversation_subject" with "Greetings" in the modal window
|
|
||||||
And I fill in "conversation_text" with "hello, alice!" in the modal window
|
|
||||||
And I press "Send" in the modal window
|
|
||||||
And I wait for the ajax to finish
|
|
||||||
Then I should see "Greetings" within "#conversation_inbox"
|
Then I should see "Greetings" within "#conversation_inbox"
|
||||||
And I should see "Greetings" within "#conversation_show"
|
And I should see "Greetings" within "#conversation_show"
|
||||||
And "Alice Awesome" should be part of active conversation
|
And "Alice Awesome" should be part of active conversation
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,15 @@ Then /^"([^"]*)" should be part of active conversation$/ do |name|
|
||||||
find("img.avatar[title^='#{name} ']").should_not be_nil
|
find("img.avatar[title^='#{name} ']").should_not be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Then /^I send a message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/ do |subject, text, person|
|
||||||
|
Given %(I am on the conversations page)
|
||||||
|
And %(I follow "New Message")
|
||||||
|
And %(I wait for the ajax to finish)
|
||||||
|
And %(I fill in "contact_autocomplete" with "#{person}" in the modal window)
|
||||||
|
And %(I press the first ".as-result-item" within ".as-results" in the modal window)
|
||||||
|
And %(I fill in "conversation_subject" with "#{subject}" in the modal window)
|
||||||
|
And %(I fill in "conversation_text" with "#{text}" in the modal window)
|
||||||
|
And %(I press "Send" in the modal window)
|
||||||
|
And %(I wait for the ajax to finish)
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue