Add cukes scenarios: playing with the aspects-dropdown and posting.

This commit is contained in:
Gonzalo Rodriguez 2011-10-23 03:46:08 -02:00
parent 4331e74673
commit 11a59b933f
2 changed files with 45 additions and 2 deletions

View file

@ -3,7 +3,7 @@ Feature: posting from the main page
In order to enlighten humanity for the good of society
As a rock star
I want to tell the world I am eating a yogurt
Background:
Given a user with username "bob"
And a user with username "alice"
@ -149,3 +149,46 @@ Feature: posting from the main page
When I am on the aspects page
And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt and also cornflakes"
Scenario: change post target aspects with the aspect-dropdown before posting
When I expand the publisher
And I press the aspect dropdown
And I toggle the aspect "PostingTo"
And I append "I am eating a yogurt" to the publisher
And I press "Share"
And I wait for the ajax to finish
And I am on the aspects page
And I select only "PostingTo" aspect
Then I should see "I am eating a yogurt"
When I am on the aspects page
And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt"
Scenario: post 2 in a row using the aspects-dropdown
When I expand the publisher
And I press the aspect dropdown
And I toggle the aspect "PostingTo"
And I append "I am eating a yogurt" to the publisher
And I press "Share"
And I wait for the ajax to finish
And I expand the publisher
And I press the aspect dropdown
And I toggle the aspect "Besties"
And I append "And cornflakes also" to the publisher
And I press "Share"
And I wait for the ajax to finish
And I am on the aspects page
And I select only "PostingTo" aspect
Then I should see "I am eating a yogurt"
Then I should see "And cornflakes also"
When I am on the aspects page
And I select only "Besties" aspect
Then I should not see "I am eating a yogurt"
Then I should see "And cornflakes also"
When I am on the aspects page
And I select only "NotPostingThingsHere" aspect
Then I should not see "I am eating a yogurt"
Then I should not see "And cornflakes also"

View file

@ -17,7 +17,7 @@ end
And /^I toggle the aspect "([^"]*)"$/ do |aspect_name|
aspect = @me.aspects.where(:name => aspect_name).first
find("li[data-aspect_id='#{aspect.id}']").click
find(".dropdown li[data-aspect_id='#{aspect.id}']").click
end
Then /^the publisher should be collapsed$/ do