Skip to content

Commit

Permalink
move response.body into rspec failure notification details
Browse files Browse the repository at this point in the history
hornc committed Jan 13, 2016
1 parent 986a34e commit 79aac07
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/apivore/validator.rb
Original file line number Diff line number Diff line change
@@ -28,10 +28,7 @@ def matches?(swagger_checker)
post_checks(swagger_checker)

if has_errors? && response.body.length > 0
puts "XXXXXXXXXXXXXXXX"
puts "Response body for '#{method} #{full_path(swagger_checker)}'\n"
puts JSON.pretty_generate(JSON.parse(response.body))
puts "XXXXXXXXXXXXXXXX"
errors << "\nResponse body:\n #{JSON.pretty_generate(JSON.parse(response.body))}"
end

swagger_checker.remove_tested_end_point_response(
@@ -59,7 +56,6 @@ def apivore_build_path(path, data)
path + (data['_query_string'] ? "?#{data['_query_string']}" : '')
end


def pre_checks(swagger_checker)
check_request_path(swagger_checker)
end
@@ -92,7 +88,6 @@ def check_status_code
if response.status != expected_response_code
errors << "Path #{path} did not respond with expected status code."\
" Expected #{expected_response_code} got #{response.status}"\
"\nResponse body: #{response.body}"
end
end

0 comments on commit 79aac07

Please sign in to comment.