Module: RSpec::RubyContentMatchers::Roles

Defined in:
lib/matchers/have_roles.rb

Instance Method Summary collapse

Instance Method Details

#have_default_rolesObject



6
7
8
# File 'lib/matchers/have_roles.rb', line 6

def have_default_roles
  have_call :valid_roles_are, :args => [:admin, :guest]
end

#have_roles_class(clazz) ⇒ Object



23
24
25
# File 'lib/matchers/have_roles.rb', line 23

def have_roles_class clazz
  have_call :role_class, clazz.to_sym
end

#have_roles_orm(orm_name) ⇒ Object



19
20
21
# File 'lib/matchers/have_roles.rb', line 19

def have_roles_orm orm_name
  include_module "Roles::#{orm_name.to_s.camelize}"
end

#have_roles_strategy(strategy, options = nil) ⇒ Object



14
15
16
17
# File 'lib/matchers/have_roles.rb', line 14

def have_roles_strategy strategy, options = nil
  return have_call :strategy, strategy.to_sym if !options
  have_call :strategy, :args => [strategy.to_sym, options]
end

#have_valid_roles(*names) ⇒ Object



10
11
12
# File 'lib/matchers/have_roles.rb', line 10

def have_valid_roles *names
  have_call :valid_roles, :args => names
end