spec/plugin/default_headers_spec.rb in roda-1.2.0 vs spec/plugin/default_headers_spec.rb in roda-1.3.0
- old
+ new
@@ -28,15 +28,14 @@
end
req[1].should == h
end
- it "should allow modifying the default headers at a later point" do
+ it "should allow modifying the default headers by reloading the plugin" do
app(:bare) do
- plugin :default_headers
- default_headers['Content-Type'] = 'text/json'
- default_headers['Foo'] = 'baz'
+ plugin :default_headers, 'Content-Type' => 'text/json'
+ plugin :default_headers, 'Foo' => 'baz'
route do |r|
r.halt response.finish_with_body([])
end
end
@@ -46,12 +45,10 @@
it "should work correctly in subclasses" do
h = {'Content-Type'=>'text/json', 'Foo'=>'bar'}
app(:bare) do
- plugin :default_headers
- default_headers['Content-Type'] = 'text/json'
- default_headers['Foo'] = 'bar'
+ plugin :default_headers, h
route do |r|
r.halt response.finish_with_body([])
end
end