From 9489a545b1f47795aa6bba395ffefbd60fe62d58 Mon Sep 17 00:00:00 2001 From: aslakhellesoy Date: Sun, 26 Dec 2010 23:46:12 -0600 Subject: [PATCH] Added scenario for bjeanes selectors stuff --- features/rails3.feature | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/features/rails3.feature b/features/rails3.feature index bee642a0..fec726c4 100644 --- a/features/rails3.feature +++ b/features/rails3.feature @@ -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: + """ +
foo
+
bar
+ """ + 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) + """