You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2013/02/19 14:00:57 UTC

[7/7] git commit: Tests: Be more verbose when checking state in Mock tests

Updated Branches:
  refs/heads/master 4dee8b778 -> 53d9301f8


Tests: Be more verbose when checking state in Mock tests

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


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/53d9301f
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/53d9301f
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/53d9301f

Branch: refs/heads/master
Commit: 53d9301f8cbfc915fa55a74651f3dd61609ae1b8
Parents: 3e6721b
Author: Michal Fojtik <mf...@redhat.com>
Authored: Mon Feb 18 14:27:45 2013 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Tue Feb 19 13:57:02 2013 +0100

----------------------------------------------------------------------
 .../collections/instances_collection_test.rb       |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/53d9301f/server/tests/deltacloud/collections/instances_collection_test.rb
----------------------------------------------------------------------
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'