Skip to content

Commit 59287ad

Browse files
blakenumbata
authored andcommitted
Add test
1 parent 10ba1a9 commit 59287ad

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
describe 'deprecated endpoint' do
6+
def app
7+
Class.new(Grape::API) do
8+
desc 'Deprecated endpoint', deprecated: true
9+
get '/foobar' do
10+
{ foo: 'bar' }
11+
end
12+
13+
add_swagger_documentation openapi_version: '3.0'
14+
end
15+
end
16+
17+
subject do
18+
get '/swagger_doc.json'
19+
JSON.parse(last_response.body)
20+
end
21+
22+
it 'includes the deprecated field' do
23+
expect(subject['paths']['/foobar']['get']['deprecated']).to eql(true)
24+
end
25+
end

0 commit comments

Comments
 (0)