You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2012/03/20 12:23:48 UTC

[PATCH core 3/4] Core: Updated unit tests to reflect reboot operation code

From: Michal Fojtik <mf...@redhat.com>

Mock unit tests updated to expect 202 code instead of 200.
Also removed non-authenticated routes, which are now under
authentication.

Signed-off-by: Michal fojtik <mf...@redhat.com>
---
 server/tests/drivers/mock/instance_states_test.rb |    4 ----
 server/tests/drivers/mock/instances_test.rb       |    2 +-
 server/tests/drivers/mock/realms_test.rb          |    4 ----
 3 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/server/tests/drivers/mock/instance_states_test.rb b/server/tests/drivers/mock/instance_states_test.rb
index d145975..905cff3 100644
--- a/server/tests/drivers/mock/instance_states_test.rb
+++ b/server/tests/drivers/mock/instance_states_test.rb
@@ -25,10 +25,6 @@ module DeltacloudUnitTest
       Sinatra::Application
     end
 
-    def test_it_not_require_authentication
-      require_authentication?('/api/realms').should_not == true
-    end
-
     def test_it_returns_instance_states
       get_auth_url '/api/instance_states', {}
       (last_xml_response/'states/state').length.should > 0
diff --git a/server/tests/drivers/mock/instances_test.rb b/server/tests/drivers/mock/instances_test.rb
index a44ba22..45bb4b8 100644
--- a/server/tests/drivers/mock/instances_test.rb
+++ b/server/tests/drivers/mock/instances_test.rb
@@ -167,7 +167,7 @@ module DeltacloudUnitTest
         reboot_url = (last_xml_response/'actions/link[@rel="reboot"]').first['href']
         reboot_url.should_not == nil
         post_url reboot_url
-        last_response.status.should == 200
+        last_response.status.should == 202
         instance = Nokogiri::XML(last_response.body)
         test_instance_attributes(instance)
         (instance/'state').text.should == 'RUNNING'
diff --git a/server/tests/drivers/mock/realms_test.rb b/server/tests/drivers/mock/realms_test.rb
index 0fa50f4..b0db9e4 100644
--- a/server/tests/drivers/mock/realms_test.rb
+++ b/server/tests/drivers/mock/realms_test.rb
@@ -25,10 +25,6 @@ module DeltacloudUnitTest
       Sinatra::Application
     end
 
-    def test_it_not_require_authentication
-      require_authentication?('/api/realms').should_not == true
-    end
-
     def test_it_returns_realms
       get_auth_url '/api/realms', {}
       (last_xml_response/'realms/realm').length.should > 0
-- 
1.7.9.1