Skip to content

Instantly share code, notes, and snippets.

@chalkers
Created April 21, 2010 19:03
Show Gist options
  • Save chalkers/374256 to your computer and use it in GitHub Desktop.
Save chalkers/374256 to your computer and use it in GitHub Desktop.
Scenario: Ordering
And I follow "Archive"
Then I should see the following div with id archive results:
|Article Evolution and Biology Title TAGGED: BIOLOGY, EVOLUTION|
|Article Biology Only Title TAGGED: BIOLOGY |
|Article Evolution Only Title TAGGED: EVOLUTION |
When I follow "Article Biology Only Title"
And I fill in "Content" with "This comment should be long enough!"
And I press "Create Comment"
And I follow "Archive"
Then I should see the following div with id archive results:
|Article Evolution and Biology Title TAGGED: BIOLOGY, EVOLUTION|
|Article Biology Only Title TAGGED: BIOLOGY |
|Article Evolution Only Title TAGGED: EVOLUTION |
When I follow "Last Commented"
Then I should see the following div with id archive results:
|Article Biology Only Title TAGGED: BIOLOGY |
When I follow "Last Created"
Then I should see the following div with id archive results:
|Article Evolution and Biology Title TAGGED: BIOLOGY, EVOLUTION|
|Article Biology Only Title TAGGED: BIOLOGY |
|Article Evolution Only Title TAGGED: EVOLUTION |
When I follow "Article Evolution and Biology Title"
And I fill in "Content" with "This comment should be long enough!"
And I press "Create Comment"
And I follow "Archive"
When I follow "Last Commented"
Then I should see the following div with id archive results:
|Article Evolution and Biology Title TAGGED: BIOLOGY, EVOLUTION|
|Article Biology Only Title TAGGED: BIOLOGY |
And I check "Evolution"
And press "Filter"
Then I should see the following div with id archive results:
|Article Evolution and Biology Title TAGGED: BIOLOGY, EVOLUTION|
And I should not see "Article Biology Only Title"
#I hacked some table code to use css selectors
Then /^I should see the following div with id (.+):$/ do |div_id, table|
table.rows.each_with_index do |row, i|
row.each_with_index do |cell, j|
response.should have_selector("div##{div_id.gsub(" ","_")} > div:nth-child(#{i+2})") { |td|
td.inner_text.strip.gsub("\n ", " ").gsub(/\s{2,}/, " ").should == cell
}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment