@@ -36,31 +36,6 @@ module Specs
3636 end
3737 end
3838
39- describe '#tags|description|operationId|consumes|produces|schemes|deprecated(value)' do
40- before do
41- subject . tags ( 'Blogs' , 'Admin' )
42- subject . description ( 'Some description' )
43- subject . operationId ( 'createBlog' )
44- subject . consumes ( 'application/json' , 'application/xml' )
45- subject . produces ( 'application/json' , 'application/xml' )
46- subject . schemes ( 'http' , 'https' )
47- subject . deprecated ( true )
48- end
49- let ( :api_metadata ) { { operation : { } } }
50-
51- it "adds to the 'operation' metadata" do
52- expect ( api_metadata [ :operation ] ) . to match (
53- tags : %w[ Blogs Admin ] ,
54- description : 'Some description' ,
55- operationId : 'createBlog' ,
56- consumes : [ 'application/json' , 'application/xml' ] ,
57- produces : [ 'application/json' , 'application/xml' ] ,
58- schemes : %w[ http https ] ,
59- deprecated : true
60- )
61- end
62- end
63-
6439 describe '#tags|description|operationId|consumes|produces|schemes|deprecated|security(value)' do
6540 before do
6641 subject . tags ( 'Blogs' , 'Admin' )
@@ -195,6 +170,22 @@ module Specs
195170 end
196171 end
197172
173+ describe '#link(name, attributes)' do
174+ before do
175+ subject . link ( 'GetUserByUserId' , '$ref' => '#/components/links/GetUserByUserId' )
176+ subject . link ( 'GetUserByReference' , '$ref' => '#/components/links/GetUserByReference' )
177+ end
178+
179+ let ( :api_metadata ) { { response : { } } }
180+
181+ it "adds to the 'response links' metadata" do
182+ expect ( api_metadata [ :response ] [ :links ] ) . to match (
183+ 'GetUserByUserId' => { '$ref' => '#/components/links/GetUserByUserId' } ,
184+ 'GetUserByReference' => { '$ref' => '#/components/links/GetUserByReference' }
185+ )
186+ end
187+ end
188+
198189 describe '#examples(example)' do
199190 let ( :json_example ) do
200191 {
0 commit comments