From: Michal Fojtik <[email protected]>

The XML should reflect the state change of an Instance.
Instead of checking the status code returned we should also
verify the XML.

Signed-off-by: Michal fojtik <[email protected]>
---
 server/tests/deltacloud/collections/instances_collection_test.rb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/tests/deltacloud/collections/instances_collection_test.rb 
b/server/tests/deltacloud/collections/instances_collection_test.rb
index cb1be02..7f643d7 100644
--- a/server/tests/deltacloud/collections/instances_collection_test.rb
+++ b/server/tests/deltacloud/collections/instances_collection_test.rb
@@ -48,10 +48,13 @@ describe Deltacloud::Collections::Instances do
     (xml/'error/message').first.text.strip.must_equal 'Requested method not 
allowed'
     post root_url + '/instances/' + instance_id + '/reboot'
     status.must_equal 202
+    (xml/'instance/state').first.text.strip.must_equal 'RUNNING'
     post root_url + '/instances/' + instance_id + '/stop'
     status.must_equal 202
+    (xml/'instance/state').first.text.strip.must_equal 'STOPPED'
     post root_url + '/instances/' + instance_id + '/start'
     status.must_equal 202
+    (xml/'instance/state').first.text.strip.must_equal 'RUNNING'
     post root_url + '/instances/' + instance_id + '/stop'
     status.must_equal 202
     (xml/'instance/state').first.text.strip.must_equal 'STOPPED'
-- 
1.8.1.2

Reply via email to