Sha256: 12cb729f2eacf74a3104607e93b7700249f61ef04fa5486c3262d1242ec764ac

Contents?: true

Size: 871 Bytes

Versions: 1

Compression:

Stored size: 871 Bytes

Contents

require 'test_helper'
require 'bbq/test_client'

class BbqTestClientTest < Test::Unit::TestCase
  def test_rack_test_to_env_headers_for_empty_hash
    test_client = Bbq::TestClient::RackTest.new(:app)
    assert_equal({}, test_client.to_env_headers({}))
  end

  def test_rack_test_to_env_headers_for_content_type_or_content_length
    test_client = Bbq::TestClient::RackTest.new(:app)
    result = test_client.to_env_headers({
      "content-type" => "text/plain",
      "content-length" => "40"
    })
    assert_includes(result.keys, "CONTENT_TYPE")
    assert_includes(result.keys, "CONTENT_LENGTH")
  end

  def test_rack_test_to_env_headers_for_other_headers
    test_client = Bbq::TestClient::RackTest.new(:app)
    result = test_client.to_env_headers({
      "silly-header" => "silly-value"
    })
    assert_includes(result.keys, "HTTP_SILLY_HEADER")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bbq-0.2.1 test/unit/bbq_test_client_test.rb