Sha256: 0231725e558812ea74f6e4d2e2353ea035a75f0df55cd90a321403bb3f45f07f

Contents?: true

Size: 889 Bytes

Versions: 2

Compression:

Stored size: 889 Bytes

Contents

require 'test_helper'
require 'bbq/core/test_client'

class TestClientTest < Minitest::Test

  def test_rack_test_to_env_headers_for_empty_hash
    test_client = Bbq::Core::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::Core::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::Core::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

2 entries across 2 versions & 1 rubygems

Version Path
bbq-core-0.4.0 test/test_client_test.rb
bbq-core-0.3.0 test/test_client_test.rb