Sha256: 31e8649b4cac2096ee9219cb127ff2784ef99723f79148955ab0c4731a355ca7
Contents?: true
Size: 810 Bytes
Versions: 10
Compression:
Stored size: 810 Bytes
Contents
require './test/test_helper' class QueryParameterStrategyTest < ActiveSupport::TestCase setup do @strategy = VersionCake::QueryParameterStrategy.new end test "a request with an api_version parameter retrieves the version" do request = stub(:query_parameters => {:api_version => '11', :other => 'parameter'}) assert_equal 11, @strategy.extract(request) end test "a request with an Integer api_version parameter retrieves the version" do request = stub(:query_parameters => {:api_version => 11, :other => 'parameter'}) assert_equal 11, @strategy.extract(request) end test "a request without an api_version parameter returns nil" do request = stub(:query_parameters => {:other => 'parameter', :another => 'parameter'}) assert_nil @strategy.extract(request) end end
Version data entries
10 entries across 10 versions & 2 rubygems