You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/01/09 14:58:22 UTC
[4/4] git commit: Deltacloud: fix failing server (white box) tests
for storage_snapshot
Updated Branches:
refs/heads/master 43f9b2104 -> 6a0bf40c2
Deltacloud: fix failing server (white box) tests for storage_snapshot
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/6a0bf40c
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/6a0bf40c
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/6a0bf40c
Branch: refs/heads/master
Commit: 6a0bf40c23916c5a6f9befd4dd6d7829bf10b480
Parents: 657237f
Author: marios <ma...@redhat.com>
Authored: Tue Jan 8 19:05:54 2013 +0200
Committer: marios <ma...@redhat.com>
Committed: Wed Jan 9 15:53:46 2013 +0200
----------------------------------------------------------------------
.../storage_snapshots_collection_test.rb | 2 +-
server/tests/deltacloud/common.rb | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6a0bf40c/server/tests/deltacloud/collections/storage_snapshots_collection_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/deltacloud/collections/storage_snapshots_collection_test.rb b/server/tests/deltacloud/collections/storage_snapshots_collection_test.rb
index f2e4f1c..7d8060b 100644
--- a/server/tests/deltacloud/collections/storage_snapshots_collection_test.rb
+++ b/server/tests/deltacloud/collections/storage_snapshots_collection_test.rb
@@ -41,7 +41,7 @@ describe Deltacloud::Collections::StorageSnapshots do
end
it 'properly serialize attributes in JSON' do
- check_json_serialization_for :storage_snapshot, 'snap1'
+ check_json_serialization_for :storage_snapshot, 'snap1', [:name, :description]
end
end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6a0bf40c/server/tests/deltacloud/common.rb
----------------------------------------------------------------------
diff --git a/server/tests/deltacloud/common.rb b/server/tests/deltacloud/common.rb
index e603a24..1c3f45c 100644
--- a/server/tests/deltacloud/common.rb
+++ b/server/tests/deltacloud/common.rb
@@ -13,7 +13,7 @@ end
Deltacloud.require_frontend!
-def check_json_serialization_for(model, sample_id)
+def check_json_serialization_for(model, sample_id, optional_attrs=[])
header 'Accept', 'application/json'
get root_url + "/#{model.to_s.pluralize}"
status.must_equal 200
@@ -24,6 +24,6 @@ def check_json_serialization_for(model, sample_id)
klass = self.class.const_get(model.to_s.camelize)
klass.attributes.each do |attr|
attr = attr.to_s.gsub(/_id$/,'') if attr.to_s =~ /_id$/
- json[model.to_s].keys.must_include attr.to_s
+ json[model.to_s].keys.must_include attr.to_s unless optional_attrs.include? attr
end
end