Skip to content

Commit

Permalink
Added scenario for bjeanes selectors stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Dec 27, 2010
1 parent 0634bb2 commit 9489a54
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions features/rails3.feature
Expand Up @@ -230,3 +230,36 @@ Feature: Rails 3
1 scenario (1 passed)
2 steps (2 passed)
"""

Scenario: Look within named selector
Given I have created a new Rails 3 app "rails-3-app" with cucumber-rails support
And I successfully run "rails generate scaffold cukes name:string"
And I overwrite "app/views/cukes/index.html.erb" with:
"""
<div class="foo">foo</div>
<div class="bar">bar</div>
"""
And I write to "features/tests.feature" with:
"""
Feature: Tests
Scenario: Tests
When I go to the cukes page
Then I should see "foo" within the foo div
And I should not see "bar" within the foo div
"""
And I overwrite "features/support/selectors.rb" with:
"""
module HtmlSelectorsHelpers
def selector_for(locator)
return '.foo' if locator == 'the foo div'
end
end
World(HtmlSelectorsHelpers)
"""
And I successfully run "rake db:migrate"
And I run "rake cucumber"
Then it should pass with:
"""
1 scenario (1 passed)
3 steps (3 passed)
"""

0 comments on commit 9489a54

Please sign in to comment.