Sha256: c38db60421314acb5c5c32f642a3b84dd874b47a2a3f885c1e91625a891359db
Contents?: true
Size: 1.47 KB
Versions: 1
Compression:
Stored size: 1.47 KB
Contents
# encoding: utf-8 require_relative '../spec_helper' describe '/domain-types/:type/properties/:property' do before(:all) do RestfulObjects::DomainModel.current.reset end it 'should generate a property description representation' do class PropertyTest include RestfulObjects::Object property :name, :string, friendly_name: 'a friendly name', description: 'name description' end expected = { 'id' => 'name', 'friendlyName' => 'a friendly name', 'description' => 'name description', 'optional' => true, 'memberOrder' => :integer, 'links' => [ { 'rel' => 'self', 'href' => 'http://localhost/domain-types/PropertyTest/properties/name', 'type' => 'application/json;profile="urn:org.restfulobjects:repr-types/property-description"', 'method' => 'GET' }, { 'rel' => 'up', 'href' => 'http://localhost/domain-types/PropertyTest', 'type' => 'application/json;profile="urn:org.restfulobjects:repr-types/domain-type"', 'method' => 'GET' }, { 'rel' => 'urn:org.restfulobjects:rels/return-type', 'href' => 'http://localhost/domain-types/string', 'type' => 'application/json;profile="urn:org.restfulobjects:repr-types/domain-type"', 'method' => 'GET' } ] } get '/domain-types/PropertyTest/properties/name' last_response.body.should match_json_expression expected end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
restful_objects-0.0.2 | spec/integration/domain-types_properties_spec.rb |