The authorization system should stubbed to let all the rest tests
to succeed :-)

Signed-off-by: Brice Figureau <[email protected]>
---
 spec/integration/indirector/certificate/rest.rb    |    4 +++-
 .../indirector/certificate_request/rest.rb         |    4 +++-
 .../indirector/certificate_revocation_list/rest.rb |    4 +++-
 spec/integration/indirector/report/rest.rb         |    2 ++
 spec/integration/indirector/rest.rb                |   10 ++++++++--
 5 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/spec/integration/indirector/certificate/rest.rb 
b/spec/integration/indirector/certificate/rest.rb
index e1f15d9..c42bafb 100755
--- a/spec/integration/indirector/certificate/rest.rb
+++ b/spec/integration/indirector/certificate/rest.rb
@@ -46,7 +46,9 @@ 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::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)     
           
+        
Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)
+
+        
Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:authorized?).returns(true)
     end
 
     after do
diff --git a/spec/integration/indirector/certificate_request/rest.rb 
b/spec/integration/indirector/certificate_request/rest.rb
index 59d2a54..1381876 100755
--- a/spec/integration/indirector/certificate_request/rest.rb
+++ b/spec/integration/indirector/certificate_request/rest.rb
@@ -51,7 +51,9 @@ 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::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)     
           
+        
Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)
+
+        
Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:authorized?).returns(true)
     end
 
     after do
diff --git a/spec/integration/indirector/certificate_revocation_list/rest.rb 
b/spec/integration/indirector/certificate_revocation_list/rest.rb
index 5ad2d8c..a1ba4f9 100755
--- a/spec/integration/indirector/certificate_revocation_list/rest.rb
+++ b/spec/integration/indirector/certificate_revocation_list/rest.rb
@@ -55,7 +55,9 @@ 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::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)     
           
+        
Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)
+
+        
Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:authorized?).returns(true)
     end
 
     after do
diff --git a/spec/integration/indirector/report/rest.rb 
b/spec/integration/indirector/report/rest.rb
index 6bbfbee..1150075 100644
--- a/spec/integration/indirector/report/rest.rb
+++ b/spec/integration/indirector/report/rest.rb
@@ -49,6 +49,8 @@ describe "Report REST Terminus" do
         @report = stub_everything 'report'
         @mock_model = stub_everything 'faked model', :name => "report", 
:convert_from => @report
         
Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)
+
+        
Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:authorized?).returns(true)
     end
 
     after do
diff --git a/spec/integration/indirector/rest.rb 
b/spec/integration/indirector/rest.rb
index 95fb34b..34619c4 100755
--- a/spec/integration/indirector/rest.rb
+++ b/spec/integration/indirector/rest.rb
@@ -75,7 +75,10 @@ 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::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)     
           
+            
Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)
+
+            # do not trigger the authorization layer
+            
Puppet::Network::HTTP::WEBrickREST.any_instance.stubs(:authorized?).returns(true)
         end
     
         describe "when finding a model instance over REST" do
@@ -305,7 +308,10 @@ 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::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)     
           
+            
Puppet::Indirector::Request.any_instance.stubs(:model).returns(@mock_model)
+
+            # do not trigger the authorization layer
+            
Puppet::Network::HTTP::MongrelREST.any_instance.stubs(:authorized?).returns(true)
         end
 
         after do
-- 
1.6.0.2


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to