From 21a1e788b43c45b7c5663994d801bac81253c5e4 Mon Sep 17 00:00:00 2001 From: Jon Distad and Chris Redinger Date: Thu, 3 Jun 2010 16:15:09 -0400 Subject: [PATCH] disabled inputs/selects/textareas are not put in params for the rack driver --- .../spec/session/click_button_spec.rb | 9 ++++ lib/capybara/spec/views/form.erb | 44 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/lib/capybara/spec/session/click_button_spec.rb b/lib/capybara/spec/session/click_button_spec.rb index 8045c052..bd5acc65 100644 --- a/lib/capybara/spec/session/click_button_spec.rb +++ b/lib/capybara/spec/session/click_button_spec.rb @@ -99,6 +99,15 @@ shared_examples_for "click_button" do it "should not serialize a select tag without options" do @results['tendency'].should be_nil end + + it "should not submit disabled fields" do + @results['disabled_text_field'].should be_nil + @results['disabled_textarea'].should be_nil + @results['disabled_checkbox'].should be_nil + @results['disabled_radio'].should be_nil + @results['disabled_select'].should be_nil + @results['disabled_file'].should be_nil + end end end diff --git a/lib/capybara/spec/views/form.erb b/lib/capybara/spec/views/form.erb index 3a1e5f9f..70fb3b8d 100644 --- a/lib/capybara/spec/views/form.erb +++ b/lib/capybara/spec/views/form.erb @@ -165,6 +165,50 @@ +

+ +

+ +

+