From 453cb4b3ebd8837abd444f7333950d2c7b0d4a23 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 11 May 2009 01:27:04 -0400 Subject: [PATCH] Stripping whitespace --- lib/webrat.rb | 2 +- lib/webrat/core/session.rb | 2 +- lib/webrat/rack_test.rb | 18 +++++++-------- spec/integration/rack/test/test_helper.rb | 2 +- .../integration/rack/test/webrat_rack_test.rb | 22 +++++++++---------- spec/public/click_link_spec.rb | 6 ++--- spec/public/locators/field_labeled_spec.rb | 4 ++-- spec/public/select_date_spec.rb | 2 +- spec/public/select_spec.rb | 6 ++--- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/webrat.rb b/lib/webrat.rb index 271d1e1..dd4ba8f 100644 --- a/lib/webrat.rb +++ b/lib/webrat.rb @@ -15,7 +15,7 @@ module Webrat else gem "nokogiri", ">= 1.0.6" end - + require "nokogiri" require "webrat/core/xml/nokogiri" end diff --git a/lib/webrat/core/session.rb b/lib/webrat/core/session.rb index 8551ae0..e4bbaeb 100644 --- a/lib/webrat/core/session.rb +++ b/lib/webrat/core/session.rb @@ -287,7 +287,7 @@ For example: send "#{http_method}", url, data || {}, headers end end - + def response_location canonicalize_url(response.headers["Location"]) end diff --git a/lib/webrat/rack_test.rb b/lib/webrat/rack_test.rb index c1da047..b824cee 100644 --- a/lib/webrat/rack_test.rb +++ b/lib/webrat/rack_test.rb @@ -1,32 +1,32 @@ module Webrat class RackTestSession < Session - + def initialize(rack_test_session) #:nodoc: super() @rack_test_session = rack_test_session end - + def response_body response.body end - + def response_code response.status end - + def response @rack_test_session.last_response end - + protected - + def process_request(http_method, url, data = {}, headers = {}) headers ||= {} data ||= {} - + env = headers.merge(:params => data, :method => http_method.to_s.upcase) @rack_test_session.request(url, env) end - + end -end \ No newline at end of file +end diff --git a/spec/integration/rack/test/test_helper.rb b/spec/integration/rack/test/test_helper.rb index 4aa659e..56298ef 100644 --- a/spec/integration/rack/test/test_helper.rb +++ b/spec/integration/rack/test/test_helper.rb @@ -13,7 +13,7 @@ class Test::Unit::TestCase include Rack::Test::Methods include Webrat::Methods include Webrat::Matchers - + def app RackApp.new end diff --git a/spec/integration/rack/test/webrat_rack_test.rb b/spec/integration/rack/test/webrat_rack_test.rb index b75147a..4fdef09 100644 --- a/spec/integration/rack/test/webrat_rack_test.rb +++ b/spec/integration/rack/test/webrat_rack_test.rb @@ -6,12 +6,12 @@ class WebratRackTest < Test::Unit::TestCase response = visit "/" assert response.ok? end - + def test_last_response_is_available visit "/" assert last_response.ok? end - + def test_last_request_is_available visit "/" assert_equal "/", last_request.env["PATH_INFO"] @@ -21,45 +21,45 @@ class WebratRackTest < Test::Unit::TestCase visit "/redirect_absolute_url" assert_equal "spam", response_body end - + def test_assertions_after_visit visit "/" assert_contain "Hello World" end - + def test_assertions_after_visit get "/" assert_contain "Hello World" end - + # def test_visits_pages # visit "/" # assert response_body.include?("visit") - # + # # click_link "there" # assert response_body.include?('
') # end - # + # # def test_submits_form # visit "/go" # fill_in "Name", :with => "World" # fill_in "Email", :with => "world@example.org" # click_button "Submit" - # + # # assert response_body.include?("Hello, World") # assert response_body.include?("Your email is: world@example.org") # end - # + # # def test_check_value_of_field # visit "/" # assert field_labeled("Prefilled").value, "text" # end - # + # # def test_follows_internal_redirects # visit "/internal_redirect" # assert response_body.include?("visit") # end - # + # # def test_does_not_follow_external_redirects # visit "/external_redirect" # assert response_code == 302 diff --git a/spec/public/click_link_spec.rb b/spec/public/click_link_spec.rb index a4a3b31..82fcdfe 100644 --- a/spec/public/click_link_spec.rb +++ b/spec/public/click_link_spec.rb @@ -101,7 +101,7 @@ describe "click_link" do webrat_session.should_receive(:get).with("http://www.example.com/page", {}) click_link /_text_/ end - + it "should click links by title" do with_html <<-HTML @@ -111,7 +111,7 @@ describe "click_link" do webrat_session.should_receive(:get).with("http://www.example.com/page", {}) click_link 'piddle' end - + it "should click links by title regex" do with_html <<-HTML @@ -121,7 +121,7 @@ describe "click_link" do webrat_session.should_receive(:get).with("http://www.example.com/page", {}) click_link /iddle/ end - + it "should click rails javascript links with authenticity tokens" do with_html <<-HTML diff --git a/spec/public/locators/field_labeled_spec.rb b/spec/public/locators/field_labeled_spec.rb index 6828a9b..8d4578d 100644 --- a/spec/public/locators/field_labeled_spec.rb +++ b/spec/public/locators/field_labeled_spec.rb @@ -153,7 +153,7 @@ describe "field_labeled" do should_return_a Webrat::TextField, :for => "The Label" with_an_id_of "element_42", :for => "The Label" end - + describe "finding a field whose label ends with an non word character" do using_this_html <<-HTML @@ -163,7 +163,7 @@ describe "field_labeled" do
HTML - + should_return_a Webrat::TextField, :for => "License #" with_an_id_of "element_42", :for => "License #" should_raise_error_matching /Could not find .* "Other License #"/, :for => "Other License #" diff --git a/spec/public/select_date_spec.rb b/spec/public/select_date_spec.rb index 9ccf0e5..a5923a5 100644 --- a/spec/public/select_date_spec.rb +++ b/spec/public/select_date_spec.rb @@ -71,7 +71,7 @@ describe "select_date" do select_date "December 25, 2003" click_button end - + it "should work when the label ends in a non word character" do with_html <<-HTML diff --git a/spec/public/select_spec.rb b/spec/public/select_spec.rb index e35db85..34b6c31 100644 --- a/spec/public/select_spec.rb +++ b/spec/public/select_spec.rb @@ -231,7 +231,7 @@ describe "select" do }.should_not raise_error(Webrat::NotFoundError) end end - + it "should submit duplicates selected options as a single value" do with_html <<-HTML @@ -241,9 +241,9 @@ describe "select" do HTML - + webrat_session.should_receive(:post).with("http://www.example.com/login", "clothes" => "pants") click_button end - + end