33 lines
614 B
Ruby
33 lines
614 B
Ruby
require 'spec_helper'
|
|
|
|
describe 'definitions/models' do
|
|
include_context "the api entities"
|
|
|
|
before :all do
|
|
module TheApi
|
|
class ModelApi < Grape::API
|
|
format :json
|
|
|
|
add_swagger_documentation models: [
|
|
TheApi::Entities::UseResponse,
|
|
TheApi::Entities::ApiError
|
|
]
|
|
end
|
|
end
|
|
end
|
|
|
|
def app
|
|
TheApi::ModelApi
|
|
end
|
|
|
|
subject do
|
|
get '/swagger_doc'
|
|
JSON.parse(last_response.body)
|
|
end
|
|
|
|
specify do
|
|
expect(subject).to include 'definitions'
|
|
expect(subject['definitions']).to include 'ResponseItem', 'UseResponse', 'ApiError'
|
|
end
|
|
end
|