diff --git a/History.txt b/History.txt index c6509d5..cf80890 100644 --- a/History.txt +++ b/History.txt @@ -1,3 +1,9 @@ +== Trunk + +* Bug fixes + + * Fix regression of not sending default values in password fields + == 0.2.0 / 2008-04-04 * 4 Major enhancements diff --git a/lib/webrat/session.rb b/lib/webrat/session.rb index 9654380..4fbae9f 100644 --- a/lib/webrat/session.rb +++ b/lib/webrat/session.rb @@ -416,7 +416,7 @@ module ActionController def add_default_params_from_inputs_for(form) # :nodoc: (form / "input").each do |input| - next unless %w[text hidden].include?(input.attributes["type"]) + next unless %w[text password hidden].include?(input.attributes["type"]) add_form_data(input, input.attributes["value"]) end end diff --git a/test/clicks_button_test.rb b/test/clicks_button_test.rb index ab8588b..c6bb5d4 100644 --- a/test/clicks_button_test.rb +++ b/test/clicks_button_test.rb @@ -125,6 +125,17 @@ class ClicksButtonTest < Test::Unit::TestCase @session.expects(:post_via_redirect).with("/login", {}) @session.clicks_button("Login") end + + def test_should_send_default_password_field_values + @response.stubs(:body).returns(<<-EOS) +
+ EOS + @session.expects(:get_via_redirect).with("/login", "user" => {"password" => "mypass"}) + @session.clicks_button + end def test_should_send_default_hidden_field_values @response.stubs(:body).returns(<<-EOS)