From 6cd9c9c2d012f06cc3b6c8321866de754a44c5df Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Sat, 8 Oct 2011 18:33:56 -0200 Subject: [PATCH] Refactor syntax on some cukes --- features/infinite_scroll.feature | 2 +- features/posts_from_main_page.feature | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/features/infinite_scroll.feature b/features/infinite_scroll.feature index 6cdf774e3..323c6bea2 100644 --- a/features/infinite_scroll.feature +++ b/features/infinite_scroll.feature @@ -11,7 +11,7 @@ Feature: infinite scroll And I wait for the ajax to finish Scenario: on the main stream by activity - And I follow "commented on" + When I follow "commented on" And I wait for the ajax to finish Then I should see 15 posts And I should see "alice - 26 - #seeded" diff --git a/features/posts_from_main_page.feature b/features/posts_from_main_page.feature index 1395f7531..0bd76018f 100644 --- a/features/posts_from_main_page.feature +++ b/features/posts_from_main_page.feature @@ -5,17 +5,14 @@ Feature: posting from the main page I want to tell the world I am eating a yogurt Background: - Given I am on the home page - And a user with username "bob" + Given a user with username "bob" And a user with username "alice" - - When I sign in as "bob@bob.bob" + And I sign in as "bob@bob.bob" And a user with username "bob" is connected with "alice" And I have an aspect called "PostingTo" And I have an aspect called "NotPostingThingsHere" And I have user with username "alice" in an aspect called "PostingTo" And I have user with username "alice" in an aspect called "NotPostingThingsHere" - And I am on the home page Scenario: post a text-only message to all aspects @@ -42,14 +39,14 @@ Feature: posting from the main page Scenario: post a photo with text Given I expand the publisher - And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" + When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" And I fill in "status_message_fake_text" with "Look at this dog" And I press "Share" And I wait for the ajax to finish And I go to the aspects page Then I should see a "img" within ".stream_element div.photo_attachments" And I should see "Look at this dog" within ".stream_element" - Then I log out + When I log out And I sign in as "alice@alice.alice" And I go to "bob@bob.bob"'s page Then I should see a "img" within ".stream_element div.photo_attachments" @@ -57,14 +54,14 @@ Feature: posting from the main page Scenario: post a photo without text Given I expand the publisher - And I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" + When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" And I wait for the ajax to finish Then I should see an uploaded image within the photo drop zone - And I press "Share" + When I press "Share" And I wait for the ajax to finish And I go to the aspects page Then I should see a "img" within ".stream_element div.photo_attachments" - Then I log out + When I log out And I sign in as "alice@alice.alice" And I go to "bob@bob.bob"'s page Then I should see a "img" within ".stream_element div.photo_attachments" @@ -118,16 +115,15 @@ Feature: posting from the main page And I wait for the ajax to finish And I go to "bob@bob.bob"'s page Then I should not see "Here is a post for you to hide" - And I am on the aspects page + When I am on the aspects page Then I should not see "Here is a post for you to hide" Scenario: delete one of my posts - When I expand the publisher - And I fill in "status_message_fake_text" with "I am eating a yogurt" + Given I expand the publisher + When I fill in "status_message_fake_text" with "I am eating a yogurt" And I press "Share" And I wait for the ajax to finish - - When I go to the aspects page + And I go to the aspects page And I hover over the ".stream_element" And I preemptively confirm the alert And I click to delete the first post