Class: MuckEngine::Controllers::Matchers::RequireRoleMatcher
- Inherits:
-
Object
- Object
- MuckEngine::Controllers::Matchers::RequireRoleMatcher
- Defined in:
- lib/muck-engine/test/controllers/matchers/role_matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(role, action, verb, role_url, flash_message, context) ⇒ RequireRoleMatcher
constructor
A new instance of RequireRoleMatcher.
- #matches?(controller) ⇒ Boolean
Constructor Details
#initialize(role, action, verb, role_url, flash_message, context) ⇒ RequireRoleMatcher
Returns a new instance of RequireRoleMatcher.
21 22 23 24 25 26 27 28 |
# File 'lib/muck-engine/test/controllers/matchers/role_matcher.rb', line 21 def initialize(role, action, verb, role_url, , context) @role = role @action = action @verb = verb @role_url = role_url @context = context @flash_message = end |
Instance Method Details
#description ⇒ Object
39 40 41 |
# File 'lib/muck-engine/test/controllers/matchers/role_matcher.rb', line 39 def description "require role #{@action}" end |
#failure_message ⇒ Object
35 36 37 |
# File 'lib/muck-engine/test/controllers/matchers/role_matcher.rb', line 35 def "Expected a '#{@action}' to '#{@action}' to require role '#{@role}'" end |
#matches?(controller) ⇒ Boolean
30 31 32 33 |
# File 'lib/muck-engine/test/controllers/matchers/role_matcher.rb', line 30 def matches?(controller) @controller = controller requires_role? end |