Class: VRaptorMatchers::RedirectTo

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/vraptor/matchers.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ RedirectTo

Returns a new instance of RedirectTo.



3
4
5
# File 'lib/spec/vraptor/matchers.rb', line 3

def initialize(path)
  @path = path
end

Instance Method Details

#failure_messageObject



12
13
14
# File 'lib/spec/vraptor/matchers.rb', line 12

def failure_message
  "expected response to redirect to #{@path}, is redirecting to #{@response.destination}"
end

#matches?(response) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/spec/vraptor/matchers.rb', line 7

def matches?(response)
  @response = response
  @response.destination.eql? @path
end