spec/plugin/default_headers_spec.rb in roda-2.1.0 vs spec/plugin/default_headers_spec.rb in roda-2.2.0

- old
+ new

@@ -41,9 +41,23 @@ end req[1].should == {'Content-Type'=>'text/json', 'Foo'=>'baz'} end + it "should have a default Content-Type header" do + h = {'Foo'=>'bar'} + + app(:bare) do + plugin :default_headers, h + + route do |r| + r.halt response.finish_with_body([]) + end + end + + req[1].should == {'Content-Type'=>'text/html', 'Foo'=>'bar'} + end + it "should work correctly in subclasses" do h = {'Content-Type'=>'text/json', 'Foo'=>'bar'} app(:bare) do plugin :default_headers, h