Class: Bbq::Core::TestUser

Inherits:
Object
  • Object
show all
Includes:
Roles, CapybaraDsl, Eyes, Within
Defined in:
lib/bbq/core/test_user.rb,
lib/bbq/core/test_user/eyes.rb,
lib/bbq/core/test_user/within.rb,
lib/bbq/core/test_user/capybara_dsl.rb

Defined Under Namespace

Modules: CapybaraDsl, Eyes, Within

Constant Summary

Constants included from Within

Within::METHODS_USING_WITHIN

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Roles

#roles

Methods included from Within

#using_within

Methods included from Eyes

#not_see?, #see?

Constructor Details

#initialize(options = {}) ⇒ TestUser

Returns a new instance of TestUser.



17
18
19
# File 'lib/bbq/core/test_user.rb', line 17

def initialize(options = {})
  @options = default_options.merge(options)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



15
16
17
# File 'lib/bbq/core/test_user.rb', line 15

def options
  @options
end

Instance Method Details

#default_optionsObject



21
22
23
24
25
26
# File 'lib/bbq/core/test_user.rb', line 21

def default_options
  {
    :pool   => Bbq::Core::Session.pool,
    :driver => ::Capybara.default_driver
  }
end

#pageObject



28
29
30
# File 'lib/bbq/core/test_user.rb', line 28

def page
  @page ||= options[:session] || Bbq::Core::Session.next(:driver => options[:driver], :pool => options[:pool])
end