diff options
author | Luke Kanies <luke@madstop.com> | 2009-03-19 23:58:19 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-03-20 18:27:08 +1100 |
commit | 0179e945a7d402c90a333c8207243882af362e06 (patch) | |
tree | e977d49f50c7907a67799bd8d445f833f9c823ee /spec/integration/indirector | |
parent | a497263d97229489dcc4341cc98ca3c75f116374 (diff) | |
download | puppet-0179e945a7d402c90a333c8207243882af362e06.tar.gz puppet-0179e945a7d402c90a333c8207243882af362e06.tar.xz puppet-0179e945a7d402c90a333c8207243882af362e06.zip |
Fixing #1557 - Environments are now in REST URIs
This commit includes multiple, related changes, all
in one commit because the whole thing was necessary to
reach a functional tree again:
* The URI starts with the environment, so:
/production/certificate/foo
/development/file_content/path/to/your/file
* All REST handling is done by a single instance mounted
at / for webrick and Mongrel, rather than having individual
instances mounted at, say, /certificate.
* All REST URI translation is done by an API module. Currently
only the 'v1' module exists with no support for additional modules,
but it's well-separated and will be easy to expand as we need it.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/integration/indirector')
5 files changed, 10 insertions, 10 deletions
diff --git a/spec/integration/indirector/certificate/rest.rb b/spec/integration/indirector/certificate/rest.rb index 5ddb0026a..e1f15d9c9 100755 --- a/spec/integration/indirector/certificate/rest.rb +++ b/spec/integration/indirector/certificate/rest.rb @@ -46,7 +46,7 @@ describe "Certificate REST Terminus" do # passed through REST; otherwise we'd be stubbing 'find', which would cause an immediate # return. @mock_model = stub('faked model', :name => "certificate") - Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end after do diff --git a/spec/integration/indirector/certificate_request/rest.rb b/spec/integration/indirector/certificate_request/rest.rb index f8ca1ecb6..59d2a5486 100755 --- a/spec/integration/indirector/certificate_request/rest.rb +++ b/spec/integration/indirector/certificate_request/rest.rb @@ -51,7 +51,7 @@ describe "Certificate Request REST Terminus" do # passed through REST; otherwise we'd be stubbing 'find', which would cause an immediate # return. @mock_model = stub('faked model', :name => "certificate request") - Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end after do diff --git a/spec/integration/indirector/certificate_revocation_list/rest.rb b/spec/integration/indirector/certificate_revocation_list/rest.rb index 8df4ad3e1..5ad2d8c90 100755 --- a/spec/integration/indirector/certificate_revocation_list/rest.rb +++ b/spec/integration/indirector/certificate_revocation_list/rest.rb @@ -55,7 +55,7 @@ describe "Certificate REST Terminus" do # passed through REST; otherwise we'd be stubbing 'find', which would cause an immediate # return. @mock_model = stub('faked model', :name => "certificate") - Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end after do diff --git a/spec/integration/indirector/report/rest.rb b/spec/integration/indirector/report/rest.rb index 5b3755426..6bbfbee66 100644 --- a/spec/integration/indirector/report/rest.rb +++ b/spec/integration/indirector/report/rest.rb @@ -48,7 +48,7 @@ describe "Report REST Terminus" do # return. @report = stub_everything 'report' @mock_model = stub_everything 'faked model', :name => "report", :convert_from => @report - Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end after do diff --git a/spec/integration/indirector/rest.rb b/spec/integration/indirector/rest.rb index cfaaa5027..95fb34bd9 100755 --- a/spec/integration/indirector/rest.rb +++ b/spec/integration/indirector/rest.rb @@ -75,7 +75,7 @@ describe Puppet::Indirector::REST do # passed through REST; otherwise we'd be stubbing 'find', which would cause an immediate # return. @mock_model = stub('faked model', :name => "foo") - Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end describe "when finding a model instance over REST" do @@ -117,7 +117,7 @@ describe Puppet::Indirector::REST do describe "when no matching model instance can be found" do before :each do @mock_model = stub('faked model', :name => "foo", :find => nil) - Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end it "should return nil" do @@ -129,7 +129,7 @@ describe Puppet::Indirector::REST do before :each do @mock_model = stub('faked model', :name => "foo") @mock_model.stubs(:find).raises(RuntimeError) - Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end it "should raise an exception" do @@ -177,7 +177,7 @@ describe Puppet::Indirector::REST do describe "when no matching model instance can be found" do before :each do @mock_model = stub('faked model', :name => "foo", :find => nil) - Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end it "should return nil" do @@ -189,7 +189,7 @@ describe Puppet::Indirector::REST do before :each do @mock_model = stub('faked model') @mock_model.stubs(:find).raises(RuntimeError) - Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end it "should raise an exception" do @@ -305,7 +305,7 @@ describe Puppet::Indirector::REST do # passed through REST; otherwise we'd be stubbing 'find', which would cause an immediate # return. @mock_model = stub('faked model', :name => "foo") - Puppet::Network::HTTP::MongrelREST.any_instance.stubs(:model).returns(@mock_model) + Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model) end after do |