Simplify response header validation

Change to checks for the presence of required headers instead of using 
JSON::Validator
This commit is contained in:
vinhbachsy
2016-10-20 01:33:43 +08:00
parent 9d4069bcfe
commit 64b0de494f
2 changed files with 5 additions and 11 deletions

View File

@@ -96,9 +96,8 @@ module Rswag
context 'response code matches & body does not' do
let(:response) { OpenStruct.new(code: 200, body: '{}', headers: {
'X-Rate-Limit-Limit' => 'invalid',
'X-Rate-Limit-Remaining' => 'invalid',
'X-Rate-Limit-Reset' => 'invalid'
'X-Rate-Limit-Limit' => 1,
'X-Rate-Limit-Remaining' => 1
}) }
it { expect { call }.to raise_error UnexpectedResponse }
end