Permalink
Browse files

fix position of ? and add step def for filling in

  • Loading branch information...
jorahood committed Jul 26, 2011
1 parent 5863a7b commit cfe6705b36ebccc4ee1e14cea9e56fa0260a4c64
Showing with 15 additions and 1 deletion.
  1. +15 −1 features/step_definitions/all_steps.rb
@@ -41,14 +41,28 @@ def frame_id
fill_in(field, :with => pystring)
end
+Given /^(?:|I )fill in "([^"]*)" in the frame with$/ do |field, pystring|
+ within_frame frame_id() do
+ fill_in(field, :with => pystring)
+ end
+end
+
+When /^(?:|I )fill in "([^"]*)" with "([^"]*)"(?: within "([^"]*)")? in the frame$/ do |field, value, selector|
+ within_frame frame_id() do
+ with_scope(selector) do
+ fill_in(field, :with => value)
+ end
+ end
+end
+
Then /^(?:|I )should see "([^"]*)" within "([^"]*)" once$/ do |regexp, selector|
within(selector) do |content|
regexp = Regexp.new(regexp)
content.should contain_once(regexp)
end
end
-Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)") in the frame?$/ do |text, selector|
+Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")? in the frame$/ do |text, selector|
within_frame frame_id() do
with_scope(selector) do
if page.respond_to? :should

0 comments on commit cfe6705

Please sign in to comment.