Sha256: ed69c141a8fee56bb0cc02e268b765daaa4e50914a535dc2c9444f329258a50a

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grape-swagger-0.20.3 spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb