Class: Suhyo::ControllerMatchers::DenyAccess
- Inherits:
-
Object
- Object
- Suhyo::ControllerMatchers::DenyAccess
- Defined in:
- lib/suhyo/controller_matchers.rb
Instance Method Summary collapse
Instance Method Details
#failure_message ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/suhyo/controller_matchers.rb', line 9 def if @response.redirect? "expected response to deny access (403 or 302 to #{Suhyo.config.access_denied_url}). Status was #{@response.status} with redirect to #{@response.redirect_url}." else "expected response to deny access (403 or 302 to #{Suhyo.config.access_denied_url}). Status was #{@response.status}." end end |
#matches?(response) ⇒ Boolean
4 5 6 7 |
# File 'lib/suhyo/controller_matchers.rb', line 4 def matches?(response) @response = response @response.status.split(' ').first == '403' or (@response.redirect? and response.redirect_url == Suhyo.config.access_denied_url) end |
#negative_failure_message ⇒ Object
17 18 19 |
# File 'lib/suhyo/controller_matchers.rb', line 17 def 'expected response not to deny access' end |