mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 18:08:42 -05:00
14 lines
326 B
Ruby
14 lines
326 B
Ruby
def expect_json(
|
|
ok = true,
|
|
http = 200
|
|
)
|
|
expect(last_response.header['Content-Type']).to eq('application/json')
|
|
|
|
if (ok == true) then
|
|
expect(JSON.parse(last_response.body)['ok']).to eq(true)
|
|
else
|
|
expect(JSON.parse(last_response.body)['ok']).to eq(false)
|
|
end
|
|
|
|
expect(last_response.status).to eq(http)
|
|
end
|