Class: Clearance::Testing::Matchers::DenyAccessMatcher
- Inherits:
-
Object
- Object
- Clearance::Testing::Matchers::DenyAccessMatcher
- Defined in:
- lib/clearance/testing/deny_access_matcher.rb
Instance Attribute Summary collapse
-
#failure_message ⇒ Object
readonly
Returns the value of attribute failure_message.
-
#failure_message_when_negated ⇒ Object
readonly
Returns the value of attribute failure_message_when_negated.
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(context, opts) ⇒ DenyAccessMatcher
constructor
A new instance of DenyAccessMatcher.
- #matches?(controller) ⇒ Boolean
Constructor Details
#initialize(context, opts) ⇒ DenyAccessMatcher
Returns a new instance of DenyAccessMatcher.
13 14 15 16 17 18 19 20 |
# File 'lib/clearance/testing/deny_access_matcher.rb', line 13 def initialize(context, opts) @context = context @flash = opts[:flash] @url = opts[:redirect] @failure_message = '' @failure_message_when_negated = '' end |
Instance Attribute Details
#failure_message ⇒ Object (readonly)
Returns the value of attribute failure_message.
11 12 13 |
# File 'lib/clearance/testing/deny_access_matcher.rb', line 11 def @failure_message end |
#failure_message_when_negated ⇒ Object (readonly)
Returns the value of attribute failure_message_when_negated.
11 12 13 |
# File 'lib/clearance/testing/deny_access_matcher.rb', line 11 def @failure_message_when_negated end |
Instance Method Details
#description ⇒ Object
22 23 24 |
# File 'lib/clearance/testing/deny_access_matcher.rb', line 22 def description 'deny access' end |
#failure_message_for_should ⇒ Object
31 32 33 |
# File 'lib/clearance/testing/deny_access_matcher.rb', line 31 def end |
#failure_message_for_should_not ⇒ Object
35 36 37 |
# File 'lib/clearance/testing/deny_access_matcher.rb', line 35 def end |
#matches?(controller) ⇒ Boolean
26 27 28 29 |
# File 'lib/clearance/testing/deny_access_matcher.rb', line 26 def matches?(controller) @controller = controller sets_the_flash? && redirects_to_url? end |