Sha256: c4762b7ba87a6b0d189181ae4ff912622355cfb7c20d0ec6f21c279bd730c46f

Contents?: true

Size: 717 Bytes

Versions: 2

Compression:

Stored size: 717 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(File.dirname(__FILE__)))

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].should == {'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].should == {'Bar'=>'1'}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roda-2.2.0 spec/plugin/delete_empty_headers_spec.rb
roda-2.1.0 spec/plugin/delete_empty_headers_spec.rb