Sha256: 20d3826e5571676cc3e3b1388da0f9dc2500ce2a2a2b3c670b9f78a5816e3836

Contents?: true

Size: 784 Bytes

Versions: 1

Compression:

Stored size: 784 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe 'a parent less namespace' do
  include_context 'namespace example'

  before :all do
    class ParentLessApi < Grape::API
      prefix :api
      mount TheApi::ParentLessNamespaceApi
      add_swagger_documentation version: 'v1'
    end
  end

  def app
    ParentLessApi
  end

  describe 'retrieves swagger-documentation on /swagger_doc' do
    let(:route_name) { ':animal/:breed/queues/:queue_id/reservations' }
    subject do
      get '/api/swagger_doc.json'
      JSON.parse(last_response.body)
    end

    specify do
      expect(subject['paths']['/api/{animal}/{breed}/queues/{queue_id}/reservations']['get']['operationId'])
        .to start_with('getApiAnimalBreedQueuesQueueIdReservations')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gitlab-grape-swagger-1.5.0 spec/swagger_v2/parent_less_namespace_spec.rb