Sha256: 04b0f6b46fcbb210de7dbb30d0c1cbda592b1ad9aef5a4a4a9dc217979e798e6

Contents?: true

Size: 673 Bytes

Versions: 30

Compression:

Stored size: 673 Bytes

Contents

require_relative "../spec_helper"

describe "delete_empty_headers plugin" do 
  it "automatically deletes headers that are empty" do
    app(:delete_empty_headers) do |r|
      response['Foo'] = ''
      response['Content-Type'] = ''
      response['Content-Length'] = ''
      response['Bar'] = '1'
      'a'
    end

    req[1].must_equal('Bar'=>'1')
  end

  it "is called when finishing with a body" do
    app(:delete_empty_headers) do |r|
      response['Foo'] = ''
      response['Content-Type'] = ''
      response['Content-Length'] = ''
      response['Bar'] = '1'
      r.halt response.finish_with_body(['a'])
    end

    req[1].must_equal('Bar'=>'1')
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
roda-3.9.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.8.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.7.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.6.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.5.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.4.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.3.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.2.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.1.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.0.0 spec/plugin/delete_empty_headers_spec.rb