lib/bbq/test_user.rb in bbq-0.0.2.beta.1 vs lib/bbq/test_user.rb in bbq-0.0.2.beta.2

- old
+ new

@@ -1,7 +1,8 @@ require 'capybara/rails' require 'capybara/dsl' +require 'securerandom' require 'bbq/util' module Bbq class TestUser @@ -25,16 +26,24 @@ callback[:extension].send(callback[:method], self) end end def page - Capybara.using_session(session_name) do - Capybara.current_session + Capybara.using_driver(current_driver) do + Capybara.using_session(session_name) do + Capybara.current_session + end end end + # Discuss: Shall we freeze ? def session_name - @session_name ||= ActiveSupport::SecureRandom.hex(8) + @session_name ||= SecureRandom.hex(8) + end + + # Discuss: Shall we freeze ? + def current_driver + @current_driver end def roles(*names) names.each do |name| module_obj = Bbq::Util.find_module(name, self)