Sha256: 17ee7f5ce3c791fdabe1db796f86f3241f951c4ea1f35ad1d80d01303941af4a

Contents?: true

Size: 841 Bytes

Versions: 2

Compression:

Stored size: 841 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Grape::API do
  subject do
    CombinedApi = combined_api
    Class.new(Grape::API) do
      format :json
      mount CombinedApi => '/'
    end
  end

  let(:jobs_api) do
    Class.new(Grape::API) do
      namespace :one do
        namespace :two do
          namespace :three do
            get :one do
            end
            get :two do
            end
          end
        end
      end
    end
  end

  let(:combined_api) do
    JobsApi = jobs_api
    Class.new(Grape::API) do
      version :v1, using: :accept_version_header, cascade: true
      mount JobsApi
    end
  end

  def app
    subject
  end

  it 'execute first request in reasonable time' do
    started = Time.now
    get '/mount1/nested/test_method'
    expect(Time.now - started).to be < 5
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
grape-1.6.2 spec/grape/loading_spec.rb
grape-1.6.1 spec/grape/loading_spec.rb