Sha256: 28a7f5c17241556b3afa18ed2ee9dcd6163df92e00619367c4415c3e5d229c8b
Contents?: true
Size: 561 Bytes
Versions: 13
Compression:
Stored size: 561 Bytes
Contents
require './test/test_helper' class HttpHeaderStrategyTest < ActiveSupport::TestCase setup do @strategy = VersionCake::HttpHeaderStrategy.new end test "a request with an HTTP_X_API_VERSION retrieves the version" do request = stub(:headers => {'HTTP_X_API_VERSION' => '11'}) assert_equal 11, @strategy.extract(request) end test "a request without an HTTP_X_API_VERSION returns nil" do request = stub(:headers => {'HTTP_ACCEPT' => 'text/x-dvi; q=.8; mxb=100000; mxt=5.0, text/x-c'}) assert_nil @strategy.extract(request) end end
Version data entries
13 entries across 13 versions & 2 rubygems