summaryrefslogtreecommitdiffstats
path: root/spec/unit/network/http/api
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2011-02-17 15:37:12 -0800
committerPaul Berry <paul@puppetlabs.com>2011-02-17 15:37:26 -0800
commit6d5f1aa75c8c64033b56f49e87fc03258d5c158c (patch)
tree13280ce802707d5a8d52e2d7a06d5ab2610d496d /spec/unit/network/http/api
parentab27da7967e1e145d5fbc130e5fbcec6795ca775 (diff)
parent8a485608e2941ff8c7ecc706c21f906d59302dd6 (diff)
Merge branch 'ticket/2.6.next/6338' into 2.6.next
* ticket/2.6.next/6338: (#5150) Make fact REST terminus configurable to connect to inventory service (#5166) Inventory service is now searchable by timestamp. Maint: backport timestamp accessor for facts from 2.7 branch Refactored Puppet::Node::Inventory::Yaml tests in preparation for adding freshness check Refactor Puppet::Node::Inventory::Yaml in preparation for adding freshness (#5132) Provide a query REST interface for inventory
Diffstat (limited to 'spec/unit/network/http/api')
-rw-r--r--spec/unit/network/http/api/v1_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/network/http/api/v1_spec.rb b/spec/unit/network/http/api/v1_spec.rb
index 23a291cf3..d47fc8d81 100644
--- a/spec/unit/network/http/api/v1_spec.rb
+++ b/spec/unit/network/http/api/v1_spec.rb
@@ -76,6 +76,18 @@ describe Puppet::Network::HTTP::API::V1 do
@tester.uri2indirection("GET", "/env/foos/bar", {}).method.should == :search
end
+ it "should choose 'find' as the indirection method if the http method is a GET and the indirection name is facts" do
+ @tester.uri2indirection("GET", "/env/facts/bar", {}).method.should == :find
+ end
+
+ it "should choose 'save' as the indirection method if the http method is a PUT and the indirection name is facts" do
+ @tester.uri2indirection("PUT", "/env/facts/bar", {}).method.should == :save
+ end
+
+ it "should choose 'search' as the indirection method if the http method is a GET and the indirection name is inventory" do
+ @tester.uri2indirection("GET", "/env/inventory/search", {}).method.should == :search
+ end
+
it "should choose 'delete' as the indirection method if the http method is a DELETE and the indirection name is singular" do
@tester.uri2indirection("DELETE", "/env/foo/bar", {}).method.should == :destroy
end