From e5391c1d21845787d1be06a1ca9f352d81cb479e Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Sat, 20 Aug 2011 18:59:09 -0300 Subject: [PATCH] Test reply to conversations --- features/conversations.feature | 7 +++++-- features/step_definitions/conversations_steps.rb | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/features/conversations.feature b/features/conversations.feature index 9bf3b6566..ecee04472 100644 --- a/features/conversations.feature +++ b/features/conversations.feature @@ -16,7 +16,10 @@ Feature: private messages And I should see "Greetings" within "#conversation_show" And "Alice Awesome" should be part of active conversation 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 - Given I send a message with subject "Greetings" and text " " to "Alice Awesome" - Then I should not see "Greetings" within "#conversation_inbox" + When I send a message with subject "Empty Greetings" and text " " to "Alice Awesome" + Then I should not see "Empty Greetings" within "#conversation_inbox" diff --git a/features/step_definitions/conversations_steps.rb b/features/step_definitions/conversations_steps.rb index 49ca7f4cf..60e14d2e0 100644 --- a/features/step_definitions/conversations_steps.rb +++ b/features/step_definitions/conversations_steps.rb @@ -15,3 +15,12 @@ Then /^I send a message with subject "([^"]*)" and text "([^"]*)" to "([^"]*)"$/ And %(I press "Send" in the modal window) And %(I wait for the ajax to finish) 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