Sha256: 81a09feb9cb97cc6550f3f2d5aaaca97d501ba699607fc34eb285c2884a7741b

Contents?: true

Size: 903 Bytes

Versions: 16

Compression:

Stored size: 903 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe 'has no description, if details or description are nil' do
  include_context "#{MODEL_PARSER} swagger example"

  before :all do
    module TheApi
      class GfmRcDetailApi < Grape::API
        format :json

        desc nil,
             detail: nil,
             entity: Entities::UseResponse,
             failure: [{ code: 400, model: Entities::ApiError }]
        get '/use_gfm_rc_detail' do
          { 'declared_params' => declared(params) }
        end

        add_swagger_documentation
      end
    end
  end

  def app
    TheApi::GfmRcDetailApi
  end

  subject do
    get '/swagger_doc'
    JSON.parse(last_response.body)
  end

  specify do
    expect(subject['paths']['/use_gfm_rc_detail']['get']).not_to include('description')
    expect(subject['paths']['/use_gfm_rc_detail']['get']['description']).to eql(nil)
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
grape-swagger-1.6.1 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.6.0 spec/swagger_v2/description_not_initialized_spec.rb
gitlab-grape-swagger-1.5.0 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.5.0 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.4.2 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.4.1 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.4.0 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.3.1 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.3.0 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.2.1 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.2.0 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.1.0 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-1.0.0 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-0.34.2 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-0.34.1 spec/swagger_v2/description_not_initialized_spec.rb
grape-swagger-0.34.0 spec/swagger_v2/description_not_initialized_spec.rb