Sha256: 753c8a5df077c69357d4aa5830855940dd5fc086ada056b263cfc136451576ea

Contents?: true

Size: 841 Bytes

Versions: 11

Compression:

Stored size: 841 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Grape::API do
  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

  subject do
    CombinedApi = combined_api
    Class.new(Grape::API) do
      format :json
      mount CombinedApi => '/'
    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

11 entries across 11 versions & 2 rubygems

Version Path
grape-1.6.0 spec/grape/loading_spec.rb
grape-1.5.3 spec/grape/loading_spec.rb
grape-1.5.2 spec/grape/loading_spec.rb
grape-1.5.1 spec/grape/loading_spec.rb
grape-1.5.0 spec/grape/loading_spec.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.4.0/spec/grape/loading_spec.rb
grape-1.4.0 spec/grape/loading_spec.rb
grape-1.3.3 spec/grape/loading_spec.rb
grape-1.3.2 spec/grape/loading_spec.rb
grape-1.3.1 spec/grape/loading_spec.rb
grape-1.3.0 spec/grape/loading_spec.rb