Sha256: 08aded7eb2ef48a18806e245c917611f7637e0a3b2c1f55fe315c11e37553ea6

Contents?: true

Size: 566 Bytes

Versions: 5

Compression:

Stored size: 566 Bytes

Contents

require 'spec_helper'

describe VersionCake::PathParameterStrategy do
  let(:strategy) { VersionCake::PathParameterStrategy.new }
  subject { strategy.extract(request) }

  context "a request with an api_version path parameter retrieves the version" do
    let(:request) { instance_double('Request', path: 'api/v11/parameter') }

    it { is_expected.to eq 11 }
  end

  context "a request without an api_version path parameter returns nil" do
    let(:request) { instance_double('Request', path: 'parameter/parameter') }

    it { is_expected.to be_nil }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
versioncake-3.4.0 spec/unit/strategies/path_parameter_strategy_spec.rb
versioncake-3.3.0 spec/unit/strategies/path_parameter_strategy_spec.rb
versioncake-3.2.0 spec/unit/strategies/path_parameter_strategy_spec.rb
versioncake-3.1.0 spec/unit/strategies/path_parameter_strategy_spec.rb
versioncake-3.0.0 spec/unit/strategies/path_parameter_strategy_spec.rb