Class: DeclarativeAuthorization::Test::Helpers::AccessTestGenerator
- Inherits:
-
Object
- Object
- DeclarativeAuthorization::Test::Helpers::AccessTestGenerator
- Includes:
- Blockenspiel::DSL
- Defined in:
- lib/declarative_authorization/test/helpers.rb
Instance Method Summary collapse
-
#initialize(test_class) ⇒ AccessTestGenerator
constructor
A new instance of AccessTestGenerator.
- #params(name, &block) ⇒ Object
- #role(role, &block) ⇒ Object
Constructor Details
#initialize(test_class) ⇒ AccessTestGenerator
Returns a new instance of AccessTestGenerator.
112 113 114 |
# File 'lib/declarative_authorization/test/helpers.rb', line 112 def initialize(test_class) @test_class = test_class end |
Instance Method Details
#params(name, &block) ⇒ Object
116 117 118 |
# File 'lib/declarative_authorization/test/helpers.rb', line 116 def params(name, &block) @test_class.define_access_test_params_method(name, &block) end |
#role(role, &block) ⇒ Object
120 121 122 123 |
# File 'lib/declarative_authorization/test/helpers.rb', line 120 def role(role, &block) raise "Role cannot be blank!" if role.blank? Blockenspiel.invoke(block, RoleTestGenerator.new(@test_class, role)) end |