fixed Webrat::MechanizeSession - calling visit on a newly created session was failing. Default headers were not set and Webrat::Session#request_page would fail when Webrat::Session#headers was called - dup was being called on the nil headers
This commit is contained in:
parent
2fd734f9ff
commit
2d166ae2b8
@ -2,6 +2,7 @@ module Webrat
|
|||||||
class MechanizeSession < Session
|
class MechanizeSession < Session
|
||||||
|
|
||||||
def initialize(mechanize = WWW::Mechanize.new)
|
def initialize(mechanize = WWW::Mechanize.new)
|
||||||
|
super()
|
||||||
@mechanize = mechanize
|
@mechanize = mechanize
|
||||||
end
|
end
|
||||||
|
|
||||||
|
13
spec/webrat/mechanize/mechanize_session_spec.rb
Normal file
13
spec/webrat/mechanize/mechanize_session_spec.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
require File.expand_path(File.dirname(__FILE__) + "/../../../lib/webrat/mechanize")
|
||||||
|
|
||||||
|
describe Webrat::MechanizeSession do
|
||||||
|
before(:each) do
|
||||||
|
@mech = Webrat::MechanizeSession.new
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "headers method" do
|
||||||
|
it "should return empty headers for a newly initialized session" do
|
||||||
|
@mech.headers.should == {}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user