1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Added reset_sessions! method

This commit is contained in:
Jonas Nicklas 2009-11-15 23:20:37 +01:00
parent cd7c93f07b
commit 278074fdcd
2 changed files with 13 additions and 0 deletions

View file

@ -20,6 +20,10 @@ module Webcat
def current_session
session_pool["#{current_driver}#{app.object_id}"] ||= Webcat::Session.new(current_driver, app)
end
def reset_sessions!
@session_pool = nil
end
private

View file

@ -87,6 +87,15 @@ describe Webcat do
Webcat.current_session.app.should == Webcat.app
end
end
describe '.reset_sessions!' do
it "should clear any persisted sessions" do
object_id = Webcat.current_session.object_id
Webcat.current_session.object_id.should == object_id
Webcat.reset_sessions!
Webcat.current_session.object_id.should_not == object_id
end
end
describe 'the DSL' do
before do