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
|
@ -21,6 +21,10 @@ module Webcat
|
||||||
session_pool["#{current_driver}#{app.object_id}"] ||= Webcat::Session.new(current_driver, app)
|
session_pool["#{current_driver}#{app.object_id}"] ||= Webcat::Session.new(current_driver, app)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def reset_sessions!
|
||||||
|
@session_pool = nil
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def session_pool
|
def session_pool
|
||||||
|
|
|
@ -88,6 +88,15 @@ describe Webcat do
|
||||||
end
|
end
|
||||||
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
|
describe 'the DSL' do
|
||||||
before do
|
before do
|
||||||
@session = Webcat
|
@session = Webcat
|
||||||
|
|
Loading…
Reference in a new issue