Permalink
Browse files

Merge remote branch 'ignu/master'

  • Loading branch information...
jnicklas committed May 9, 2010
2 parents 66249c7 + a550cc4 commit ca2029b03a982773cb14bf9eb283175d8014039c
Showing with 6 additions and 1 deletion.
  1. +1 −0 lib/capybara/session.rb
  2. +5 −1 lib/capybara/spec/session/fill_in_spec.rb
View
@@ -62,6 +62,7 @@ def drag(source_locator, target_locator)
def fill_in(locator, options={})
msg = "cannot fill in, no text field, text area or password field with id, name, or label '#{locator}' found"
+ raise "Must pass a hash containing 'with'" unless options.kind_of? Hash && !options.index(:with).nil?
locate(:xpath, XPath.fillable_field(locator), msg).set(options[:with])
end
@@ -82,7 +82,11 @@
@session.click_button('awesome')
extract_results(@session)['name'].should == 'Ford Prefect'
end
-
+
+ it "should throw an exception if a hash containing 'with' is not provided" do
+ lambda{@session.fill_in 'Name', 'ignu'}.should raise_error
+ end
+
context "with ignore_hidden_fields" do
before { Capybara.ignore_hidden_elements = true }
after { Capybara.ignore_hidden_elements = false }

0 comments on commit ca2029b

Please sign in to comment.