diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-04-13 19:20:40 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-04-13 19:20:40 -0700 |
| commit | c7ae6bde57fd3ab8380cd5804fd87283bb708755 (patch) | |
| tree | c0712b1ac2b936fd5a3a2ea0da6c9a976c1cb7d2 /spec | |
| parent | 3ab44c7ce01ab86a995deb66228f5be95239c92a (diff) | |
| parent | 9bc4bcefb1a9f2545b4828dcea7a41ef450e7d52 (diff) | |
| download | puppet-c7ae6bde57fd3ab8380cd5804fd87283bb708755.tar.gz puppet-c7ae6bde57fd3ab8380cd5804fd87283bb708755.tar.xz puppet-c7ae6bde57fd3ab8380cd5804fd87283bb708755.zip | |
Merge branch 'ticket/next/7103' into next
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/network/http/handler_spec.rb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/spec/unit/network/http/handler_spec.rb b/spec/unit/network/http/handler_spec.rb index 83969c504..c709d82fe 100755 --- a/spec/unit/network/http/handler_spec.rb +++ b/spec/unit/network/http/handler_spec.rb @@ -240,34 +240,30 @@ describe Puppet::Network::HTTP::Handler do describe "when performing head operation" do before do - @irequest = stub 'indirection_request', :method => :head, :indirection_name => "my_handler", :to_hash => {}, :key => "my_result", :model => @model_class + @handler.stubs(:model).with("my_handler").returns(stub 'model', :indirection => @model_class) + @handler.stubs(:http_method).with(@request).returns("HEAD") + @handler.stubs(:path).with(@request).returns("/production/my_handler/my_result") + @handler.stubs(:params).with(@request).returns({}) @model_class.stubs(:head).returns true end - it "should use the indirection request to find the model class" do - @irequest.expects(:model).returns @model_class - - @handler.do_head(@irequest, @request, @response) - end - it "should use the escaped request key" do @model_class.expects(:head).with do |key, args| key == "my_result" end.returns true - @handler.do_head(@irequest, @request, @response) + @handler.process(@request, @response) end it "should not generate a response when a model head call succeeds" do @handler.expects(:set_response).never - @handler.do_head(@irequest, @request, @response) + @handler.process(@request, @response) end it "should return a 404 when the model head call returns false" do - @model_class.stubs(:name).returns "my name" @handler.expects(:set_response).with { |response, body, status| status == 404 } @model_class.stubs(:head).returns(false) - @handler.do_head(@irequest, @request, @response) + @handler.process(@request, @response) end end |
