Sha256: 1f8b8ea2fdeadcdc4e9fd1b52e9e1b72e71ccd8eafa7f5e6aa1928a08e57a3bb

Contents?: true

Size: 829 Bytes

Versions: 4

Compression:

Stored size: 829 Bytes

Contents

require File.expand_path('../../test_helper', __FILE__)

module Rainforest
  class HeadersBuilderTest < ::Test::Unit::TestCase

    setup do
      @headers = {
        :dog => "dog-value"
      }
      @built_headers = HeadersBuilder.build(@headers)
    end

    should 'set the user_agent' do
      assert(@built_headers.has_key?(:user_agent))
      assert(@built_headers[:user_agent].include?(Rainforest::VERSION))
      assert(@built_headers[:user_agent].include?(Rainforest.api_version))
    end

    should 'set a client user agent' do
      # This can be raw or json encoded depending on various things
      unless @built_headers.has_key?(:x_rainforest_client_user_agent) ||
        @built_headers.has_key?(:x_rainforest_client_raw_user_agent)
        raise "No valid client user agent found"
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rainforest-2.1.0 test/rainforest/headers_builder_test.rb
rainforest-2.0.2 test/rainforest/headers_builder_test.rb
rainforest-2.0.1 test/rainforest/headers_builder_test.rb
rainforest-2.0.0 test/rainforest/headers_builder_test.rb