Sha256: 7673a3456c23c4059c15668f27f12b4cbd95a371cb2f0bc6b644ce90c7004454
Contents?: true
Size: 654 Bytes
Versions: 2
Compression:
Stored size: 654 Bytes
Contents
require_relative '../test_helper.rb' Deltacloud.require_frontend! :deltacloud 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 json[model.to_s.pluralize].wont_be_empty get root_url + "/#{model.to_s.pluralize}/#{sample_id}" status.must_equal 200 json[model.to_s].wont_be_empty klass = Deltacloud.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 unless optional_attrs.include? attr end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
deltacloud-core-1.1.3 | tests/deltacloud/common.rb |
deltacloud-core-1.1.2 | tests/deltacloud/common.rb |