| Class | ActiveMatchers::Matchers::ResponseMatchers::SuccessMatcher |
| In: |
lib/matchers/response_matchers.rb
|
| Parent: | Object |
# File lib/matchers/response_matchers.rb, line 5 5: def initialize(controller) 6: @controller = controller 7: end
# File lib/matchers/response_matchers.rb, line 23
23: def failure_message
24: if @template.nil? || !@response.success?
25: "Response should have succeeded, but returned with code #{@response.response_code}."
26: else
27: "Response should have rendered #{@template}, but instead rendered #{@response.rendered_file}."
28: end
29: end
# File lib/matchers/response_matchers.rb, line 9
9: def matches?(response)
10: @response = response
11: if @template.nil?
12: @response.success?
13: else
14: @response.success? && full_path(@template) == full_path(@response.rendered_file)
15: end
16: end
# File lib/matchers/response_matchers.rb, line 31
31: def negative_failure_message
32: if @response.success?
33: "Response should not have succeeded, but did."
34: else
35: "Response should not have rendered #{@template}, but did."
36: end
37: end