Sha256: 324625865e42b6768d73fda23e6f9b072e85bcc82d1644268f5c286330d2426a

Contents?: true

Size: 643 Bytes

Versions: 10

Compression:

Stored size: 643 Bytes

Contents

require 'spec_helper'

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

  context "a request with an api_version request parameter retrieves the version" do
    let(:request) { instance_double('Request', POST: {'api_version' => '11', 'other' => 'parameter'}) }

    it { is_expected.to eq 11 }
  end

  context "a request without an api_version request parameter returns nil" do
    let(:request) { instance_double('Request', POST: \
      {'other' => 'parameter', 'another' => 'parameter'}) }

    it { is_expected.to be_nil }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
versioncake-4.1.1 spec/unit/strategies/request_parameter_strategy_spec.rb
versioncake-4.1.0 spec/unit/strategies/request_parameter_strategy_spec.rb
versioncake-4.0.2 spec/unit/strategies/request_parameter_strategy_spec.rb
versioncake-4.0.1 spec/unit/strategies/request_parameter_strategy_spec.rb
versioncake-4.0.0 spec/unit/strategies/request_parameter_strategy_spec.rb
versioncake-3.4.0 spec/unit/strategies/request_parameter_strategy_spec.rb
versioncake-3.3.0 spec/unit/strategies/request_parameter_strategy_spec.rb
versioncake-3.2.0 spec/unit/strategies/request_parameter_strategy_spec.rb
versioncake-3.1.0 spec/unit/strategies/request_parameter_strategy_spec.rb
versioncake-3.0.0 spec/unit/strategies/request_parameter_strategy_spec.rb