diff options
Diffstat (limited to 'spec/unit/network/http')
| -rwxr-xr-x | spec/unit/network/http/handler.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/network/http/handler.rb b/spec/unit/network/http/handler.rb index a0c817361..1addb5890 100755 --- a/spec/unit/network/http/handler.rb +++ b/spec/unit/network/http/handler.rb @@ -129,6 +129,16 @@ describe Puppet::Network::HTTP::Handler do @handler.do_exception(@response, "A test", 404) end + it "should raise an error if the request is formatted in an unknown format" do + @handler.stubs(:content_type_header).returns "unknown format" + lambda { @handler.request_format(@request) }.should raise_error + end + + it "should still find the correct format if content type contains charset information" do + @handler.stubs(:content_type_header).returns "text/plain; charset=UTF-8" + @handler.request_format(@request).should == "s" + end + describe "when finding a model instance" do before do @irequest = stub 'indirection_request', :method => :find, :indirection_name => "my_handler", :to_hash => {}, :key => "my_result", :model => @model_class |
