Commit 31330ef9a0c1bb18d8d94e28891087e25d941489

Authored by Antonio Terceiro
1 parent f1cafcb8

web_steps: make with_scope more clear

Showing 1 changed file with 8 additions and 2 deletions   Show diff stats
features/step_definitions/web_steps.rb
... ... @@ -11,8 +11,14 @@ require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "pat
11 11  
12 12 module WithinHelpers
13 13 def with_scope(locator)
14   - locator = locator ? first(locator) : locator
15   - locator ? within(locator) { yield } : yield
  14 + if locator
  15 + locator = first(locator) || locator
  16 + within(locator) do
  17 + yield
  18 + end
  19 + else
  20 + yield
  21 + end
16 22 end
17 23 end
18 24 World(WithinHelpers)
... ...