Adding step definitions to facilitate merging of multiple consecutive "I (should|should not) see " clauses on single statement, adding one example as well
This commit is contained in:
parent
fb9da740bb
commit
3d21e89b3b
2 changed files with 17 additions and 15 deletions
|
|
@ -8,9 +8,7 @@ Feature: new user registration
|
|||
And I fill in "user_password" with "secret"
|
||||
And I press "Continue"
|
||||
Then I should be on the getting started page
|
||||
And I should see "Well, hello there!"
|
||||
And I should see "Who are you?"
|
||||
And I should see "What are you into?"
|
||||
And I should see "Well, hello there!" and "Who are you?" and "What are you into?"
|
||||
|
||||
Scenario: new user goes through the setup wizard
|
||||
When I fill in the following:
|
||||
|
|
|
|||
|
|
@ -105,7 +105,8 @@ Then /^(?:|I )should see JSON:$/ do |expected_json|
|
|||
expected.should == actual
|
||||
end
|
||||
|
||||
Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
|
||||
Then /^(?:|I )should see (\".+?\"[\s]*)(?:[\s]+within[\s]* "([^"]*)")?$/ do |vars,selector|
|
||||
vars.scan(/"([^"]+?)"/).flatten.each do |text|
|
||||
with_scope(selector) do
|
||||
if page.respond_to? :should
|
||||
page.should have_content(text)
|
||||
|
|
@ -113,6 +114,7 @@ Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
|
|||
assert page.has_content?(text)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
|
||||
|
|
@ -126,7 +128,8 @@ Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, select
|
|||
end
|
||||
end
|
||||
|
||||
Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
|
||||
Then /^(?:|I )should not see (\".+?\"[\s]*)(?:[\s]+within[\s]* "([^"]*)")?$/ do |vars,selector|
|
||||
vars.scan(/"([^"]+?)"/).flatten.each do |text|
|
||||
with_scope(selector) do
|
||||
if page.respond_to? :should
|
||||
page.should have_no_content(text)
|
||||
|
|
@ -134,6 +137,7 @@ Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selecto
|
|||
assert page.has_no_content?(text)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
|
||||
|
|
|
|||
Loading…
Reference in a new issue