diff --git a/lib/webcat/driver/rack_test_driver.rb b/lib/webcat/driver/rack_test_driver.rb index d8dc8026..3f4a91ac 100644 --- a/lib/webcat/driver/rack_test_driver.rb +++ b/lib/webcat/driver/rack_test_driver.rb @@ -42,7 +42,7 @@ class Webcat::Driver::RackTest class Form < Node def params(button) params = [] - params << node.xpath(".//input[@type='text']").inject([]) do |agg, input| + params << node.xpath(".//input[@type='text']", ".//input[@type='password']").inject([]) do |agg, input| agg << param(input['name'].to_s, input['value'].to_s) agg end diff --git a/spec/session_spec.rb b/spec/session_spec.rb index 8de42bc1..c5dc255b 100644 --- a/spec/session_spec.rb +++ b/spec/session_spec.rb @@ -66,6 +66,10 @@ shared_examples_for "session" do @results['first_name'].should == 'John' end + it "should serialize and submit password fields" do + @results['password'].should == 'seeekrit' + end + it "should not serialize fields from other forms" do @results['middle_name'].should be_nil end diff --git a/spec/views/form.erb b/spec/views/form.erb index 26a57f9d..93bf32a4 100644 --- a/spec/views/form.erb +++ b/spec/views/form.erb @@ -11,6 +11,11 @@

+

+ + +

+