diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2010-10-28 15:11:01 -0700 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2010-10-28 15:11:01 -0700 |
| commit | 1b60cc3c299306d783d9b0e9368726d2c04c9f21 (patch) | |
| tree | 65d227ec46a7259a2a06221889cb48d1698dff3a /spec/unit/network/http/api | |
| parent | e559b48d51c53c4a345353de1e196634c7430195 (diff) | |
| parent | 45a9a97285d99db524d5330c236352b29e5884ed (diff) | |
Merge branch 'ticket/next/5132' into next
* ticket/next/5132:
(#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.rb | 12 |
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 c593242c0..8d507046f 100644 --- a/spec/unit/network/http/api/v1_spec.rb +++ b/spec/unit/network/http/api/v1_spec.rb @@ -72,6 +72,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 |
