mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-24 14:56:41 +00:00
Remove duplicate test block
This commit is contained in:
parent
6b4f49aacb
commit
3393263df7
@ -35,31 +35,6 @@ module Rswag
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#tags|description|operationId|consumes|produces|schemes|deprecated(value)' do
|
|
||||||
before do
|
|
||||||
subject.tags('Blogs', 'Admin')
|
|
||||||
subject.description('Some description')
|
|
||||||
subject.operationId('createBlog')
|
|
||||||
subject.consumes('application/json', 'application/xml')
|
|
||||||
subject.produces('application/json', 'application/xml')
|
|
||||||
subject.schemes('http', 'https')
|
|
||||||
subject.deprecated(true)
|
|
||||||
end
|
|
||||||
let(:api_metadata) { { operation: {} } }
|
|
||||||
|
|
||||||
it "adds to the 'operation' metadata" do
|
|
||||||
expect(api_metadata[:operation]).to match(
|
|
||||||
tags: ['Blogs', 'Admin'],
|
|
||||||
description: 'Some description',
|
|
||||||
operationId: 'createBlog',
|
|
||||||
consumes: ['application/json', 'application/xml'],
|
|
||||||
produces: ['application/json', 'application/xml'],
|
|
||||||
schemes: ['http', 'https'],
|
|
||||||
deprecated: true
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '#tags|description|operationId|consumes|produces|schemes|deprecated|security(value)' do
|
describe '#tags|description|operationId|consumes|produces|schemes|deprecated|security(value)' do
|
||||||
before do
|
before do
|
||||||
subject.tags('Blogs', 'Admin')
|
subject.tags('Blogs', 'Admin')
|
||||||
@ -179,10 +154,16 @@ module Rswag
|
|||||||
before { subject.schema(type: 'object') }
|
before { subject.schema(type: 'object') }
|
||||||
let(:api_metadata) { { response: {} } }
|
let(:api_metadata) { { response: {} } }
|
||||||
|
|
||||||
it "adds to the 'response' metadata" do
|
context 'swagger 2.0' do
|
||||||
expect(api_metadata[:response][:schema]).to match(type: 'object')
|
it "adds to the 'response' metadata" do
|
||||||
## OA3
|
expect(api_metadata[:response][:schema]).to match(type: 'object')
|
||||||
# expect(api_metadata[:response][:content]['application/json'][:schema]).to match(type: 'object')
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'openapi 3.0' do
|
||||||
|
it "adds to the 'response' metadata" do
|
||||||
|
expect(api_metadata[:response][:content]['application/json'][:schema]).to match(type: 'object')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user