From 2c9de38129aeaab666bf2040566f1ade0c90b2ae Mon Sep 17 00:00:00 2001 From: Damian Janowski Date: Tue, 13 Apr 2010 12:57:25 -0300 Subject: [PATCH] Add missing spec that shows a regression after e3bcf5. --- spec/integration/mechanize/sample_app.rb | 16 ++++++++++++++++ .../integration/mechanize/spec/mechanize_spec.rb | 10 +++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/spec/integration/mechanize/sample_app.rb b/spec/integration/mechanize/sample_app.rb index 853d1b4e..af5d8850 100644 --- a/spec/integration/mechanize/sample_app.rb +++ b/spec/integration/mechanize/sample_app.rb @@ -16,4 +16,20 @@ class SampleApp < Sinatra::Default get "/redirected" do "Redirected" end + + get "/form" do + <<-EOS + +
+ + + +
+ + EOS + end + + put "/form" do + "Welcome #{params[:email]}" + end end diff --git a/spec/integration/mechanize/spec/mechanize_spec.rb b/spec/integration/mechanize/spec/mechanize_spec.rb index 0c21da33..4b0273d8 100644 --- a/spec/integration/mechanize/spec/mechanize_spec.rb +++ b/spec/integration/mechanize/spec/mechanize_spec.rb @@ -12,7 +12,15 @@ end it "should follow links" - it "should submit forms" + + it "should submit forms" do + visit "http://localhost:9292/form" + fill_in "Email", :with => "albert@example.com" + click_button "Add" + + response.should contain("Welcome albert@example.com") + end + it "should not follow external redirects" do pending do response = visit("http://localhost:9292/external_redirect")