mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Serialize and submit password fields
This commit is contained in:
parent
c15c17451b
commit
c697d21da3
3 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -11,6 +11,11 @@
|
|||
<input type="text" name="form[last_name]" value="Smith" id="form_last_name"/>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="form_password">Password</label>
|
||||
<input type="password" name="form[password]" value="seeekrit" id="form_password"/>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label for="form_locale">Locale</label>
|
||||
<select name="form[locale]" id="form_locale">
|
||||
|
|
Loading…
Add table
Reference in a new issue