Skip to content

Commit c2e6a5a

Browse files
blakenumbata
authored andcommitted
Add test
1 parent a41d712 commit c2e6a5a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
describe 'an operation id api' do
6+
def app
7+
Class.new(Grape::API) do
8+
version '0.1'
9+
10+
desc 'Show this endpoint'
11+
get '/simple_opp' do
12+
{ foo: 'bar' }
13+
end
14+
15+
add_swagger_documentation openapi_version: '3.0', format: :json
16+
end
17+
end
18+
19+
subject do
20+
get '/0.1/swagger_doc.json'
21+
JSON.parse(last_response.body)
22+
end
23+
24+
it 'uses build name as operationId' do
25+
expect(subject['paths']['/0.1/simple_opp']['get']['operationId']).to eql('get01SimpleOpp')
26+
end
27+
end

0 commit comments

Comments
 (0)