lib/page_magic.rb in page_magic-0.9.5 vs lib/page_magic.rb in page_magic-0.9.6
- old
+ new
@@ -10,14 +10,11 @@
require 'page_magic/section'
module PageMagic
class << self
def session browser=nil, options = {}
- if browser.is_a?(Hash)
- Session.new(Capybara::Session.new(:rack_test, browser[:application]))
- else
- if browser
+ if browser.is_a?(Symbol)
application = options.delete(:application)
Capybara.register_driver browser do |app|
options[:browser] = browser
case browser
@@ -34,12 +31,12 @@
end
Session.new(Capybara::Session.new(browser, application))
else
Capybara.reset!
+ Capybara.app = browser[:application] if browser.is_a?(Hash) && browser[:application]
Session.new(Capybara.current_session)
end
- end
end
def included clazz
clazz.extend Elements
\ No newline at end of file