Add step definitions to create deferred actions

This commit is contained in:
Carsten Otto 2015-04-07 00:30:10 +02:00
parent db62ebd074
commit bf8b118ebf
2 changed files with 11 additions and 1 deletions

View file

@ -110,6 +110,12 @@ Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector|
end
end
Then /^(?:|I )should see "([^"]*)" before "([^"]*)"$/ do |earlier_content, later_content|
expect(page).to have_content(earlier_content)
expect(page).to have_content(later_content)
page.body.index(earlier_content).should < page.body.index(later_content)
end
Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector|
regexp = Regexp.new(regexp)
with_scope(selector) do