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:
parent
cd7c93f07b
commit
278074fdcd
2 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue