diff --git a/generators/cucumber/templates/step_definitions/capybara_steps.rb.erb b/generators/cucumber/templates/step_definitions/capybara_steps.rb.erb index 6e2a342b..baaf718d 100644 --- a/generators/cucumber/templates/step_definitions/capybara_steps.rb.erb +++ b/generators/cucumber/templates/step_definitions/capybara_steps.rb.erb @@ -5,7 +5,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "pat module WithinHelpers def with_scope(locator) - within(locator || 'html') { yield } + locator ? within(locator) { yield } : yield end end World(WithinHelpers)