Class ActiveMatchers::Matchers::ResponseMatchers::RedirectMatcher
In: lib/matchers/response_matchers.rb
Parent: Object

Methods

Public Class methods

[Source]

    # File lib/matchers/response_matchers.rb, line 63
63:         def initialize
64:           @action = :what
65:         end

Public Instance methods

[Source]

    # File lib/matchers/response_matchers.rb, line 85
85:         def failure_message
86:           case @action
87:           when :what
88:             "Response should have redirected, but didn't."
89:           when :where
90:             "Response should have redirected to #{@url}, but didn't."
91:           end
92:         end

[Source]

    # File lib/matchers/response_matchers.rb, line 67
67:         def matches?(response)
68:           @response = response
69:           case @action
70:           when :what
71:             @response.redirect?
72:           when :where
73:             @response.redirect? && @response.redirect_url == @url
74:           else
75:             false
76:           end
77:         end

[Source]

     # File lib/matchers/response_matchers.rb, line 94
 94:         def negative_failure_message
 95:           case @action
 96:           when :what
 97:             "Response shouldn't have redirected, but did."
 98:           when :where
 99:             "Response shouldn't have redirected to #{@url}, but did."
100:           end
101:         end

[Source]

    # File lib/matchers/response_matchers.rb, line 79
79:         def to(url)
80:           @action = :where
81:           @url = url
82:           self
83:         end

[Validate]