From 8770d20bffd953a25c0342e42e0c773fcf3ec7be Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Wed, 23 Sep 2015 11:29:46 -0300 Subject: [PATCH] step-definitions: add should not see within any step --- features/step_definitions/web_steps.rb | 8 ++++++++ 1 file changed, 8 insertions(+), 0 deletions(-) diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 5da1b6b..05a328c 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -163,6 +163,14 @@ Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, se end end +Then /^(?:|I )should not see "([^"]*)" within any "([^"]*)"?$/ do |text, selector| + if page.respond_to? :should + page.should have_no_css(selector, :text => text) + else + assert page.has_no_css?(selector, :text => text) + end +end + Then /^the "([^"]*)" field(?: within "([^"]*)")? should contain "([^"]*)"$/ do |field, selector, value| with_scope(selector) do field = find_field(field) -- libgit2 0.21.2