yield entire response instead of only the body

This commit is contained in:
Horia Radu
2017-04-29 12:06:57 +03:00
parent 51c9f4e5e6
commit 37f86f6d94
3 changed files with 7 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ module Rswag
raise UnexpectedResponse, "Expected response body to match schema: #{ex.message}"
end
block.call(JSON.parse(body)) if block_given?
block.call(body) if block_given?
end
end

View File

@@ -46,7 +46,8 @@ module Rswag
context "'block' provided" do
let(:call) do
subject.validate!(response) do |body|
expect(body['text']).to eq('Some comment')
data = JSON.parse(body)
expect(data['text']).to eq('Some comment')
end
end