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.28.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.27.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.26.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.25.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.24.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.23.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.22.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.21.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.20.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.19.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.18.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.17.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.16.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.15.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.14.1 spec/plugin/delete_empty_headers_spec.rb
roda-3.14.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.13.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.12.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.11.0 spec/plugin/delete_empty_headers_spec.rb
roda-3.10.0 spec/plugin/delete_empty_headers_spec.rb