Sha256: e897fb693f0bd28d791ec70bd06ce2ab5c2b378d36abfe4bef5973d21ab21bea

Contents?: true

Size: 658 Bytes

Versions: 10

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'

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

  context "a request with an HTTP_ACCEPT version retrieves the version" do
    let(:request) { instance_double('Request', env: \
      {'HTTP_ACCEPT' => 'application/xml; api_version=11'}) }

    it { is_expected.to eq 11 }
  end

  context "a request without an HTTP_ACCEPT version returns nil" do
    let(:request) { instance_double('Request', env: \
      {'HTTP_ACCEPT' => 'text/x-dvi; q=.8; mxb=100000; mxt=5.0, text/x-c'}) }

    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/http_accept_parameter_strategy_spec.rb
versioncake-4.1.0 spec/unit/strategies/http_accept_parameter_strategy_spec.rb
versioncake-4.0.2 spec/unit/strategies/http_accept_parameter_strategy_spec.rb
versioncake-4.0.1 spec/unit/strategies/http_accept_parameter_strategy_spec.rb
versioncake-4.0.0 spec/unit/strategies/http_accept_parameter_strategy_spec.rb
versioncake-3.4.0 spec/unit/strategies/http_accept_parameter_strategy_spec.rb
versioncake-3.3.0 spec/unit/strategies/http_accept_parameter_strategy_spec.rb
versioncake-3.2.0 spec/unit/strategies/http_accept_parameter_strategy_spec.rb
versioncake-3.1.0 spec/unit/strategies/http_accept_parameter_strategy_spec.rb
versioncake-3.0.0 spec/unit/strategies/http_accept_parameter_strategy_spec.rb