simplify validation blocks and use correct scope

This commit is contained in:
domaindrivendev
2017-07-21 22:26:14 -07:00
parent 7f0e437f8b
commit 732cab994c
6 changed files with 10 additions and 31 deletions

View File

@@ -55,20 +55,6 @@ module Rswag
it { expect { call }.to raise_error /Expected response body/ }
end
context 'validation block provided' do
let(:call) { subject.validate!(metadata, response, &block) }
context 'block passes' do
let(:block) { Proc.new { |response| expect(response.code).to eq('200') } }
it { expect { call }.to_not raise_error }
end
context 'block fails' do
let(:block) { Proc.new { |response| expect(response.code).to eq('201') } }
it { expect { call }.to raise_error RSpec::Expectations::ExpectationNotMetError }
end
end
context 'referenced schemas' do
before do
swagger_doc[:definitions] = {