mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
yield entire response instead of only the body
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user