Test reply to conversations

This commit is contained in:
Gonzalo Rodriguez 2011-08-20 18:59:09 -03:00
parent f1cf81772b
commit e5391c1d21
2 changed files with 14 additions and 2 deletions

View file

@ -16,7 +16,10 @@ Feature: private messages
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
And I should see "hello, alice!" within ".stream" And I should see "hello, alice!" within ".stream"
When I sign in as "alice@alice.alice"
And I reply with "hey, how you doing?"
Then I should see "hey, how you doing?" within ".stream"
Scenario: send an empty message Scenario: send an empty message
Given I send a message with subject "Greetings" and text " " to "Alice Awesome" When I send a message with subject "Empty Greetings" and text " " to "Alice Awesome"
Then I should not see "Greetings" within "#conversation_inbox" Then I should not see "Empty Greetings" within "#conversation_inbox"

View file

@ -15,3 +15,12 @@ Then /^I send a message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/
And %(I press "Send" in the modal window) And %(I press "Send" in the modal window)
And %(I wait for the ajax to finish) And %(I wait for the ajax to finish)
end end
When /^I reply with "([^"]*)"$/ do |text|
When %(I am on the conversations page)
And %(I press the first ".conversation" within ".conversations")
And %(I wait for the ajax to finish)
And %(I fill in "message_text" with "#{text}")
And %(I press "Reply")
And %(I wait for the ajax to finish)
end