Class: Bbq::TestUser

Inherits:
Object
  • Object
show all
Includes:
RSpecMatchers, Roles, CapybaraDsl, Eyes, Within, Capybara::RSpecMatchers, RSpec::Matchers, Test::Unit::Assertions
Defined in:
lib/bbq/test_unit.rb,
lib/bbq/rspec.rb,
lib/bbq/test_user.rb,
lib/bbq/test_user/eyes.rb,
lib/bbq/test_user/within.rb,
lib/bbq/test_user/capybara_dsl.rb

Overview

test/unit specific methods for test_user

Direct Known Subclasses

TestUser

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.



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

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#default_optionsObject



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

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

#not_see!(*args) ⇒ Object



73
74
75
# File 'lib/bbq/rspec.rb', line 73

def not_see!(*args)
  not_see?(*args).should be_true
end

#pageObject



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

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

#see!(*args) ⇒ Object



69
70
71
# File 'lib/bbq/rspec.rb', line 69

def see!(*args)
  see?(*args).should be_true
end