Sha256: 98cad220db7ae7cb1426994f1103d7ebf31152427688d7bf4ffce0cff3446a98
Contents?: true
Size: 1.52 KB
Versions: 1
Compression:
Stored size: 1.52 KB
Contents
# encoding: utf-8 require_relative '../spec_helper' describe '/domain-types/:type/actions/:action' do before(:all) do RestfulObjects::DomainModel.current.reset end it 'should generate an action description representation' do class ActionTest include RestfulObjects::Object action :do_something, :int, {}, friendly_name: 'do something!', description: 'description of something' end expected = { 'id' => 'do_something', 'friendlyName' => 'do something!', 'description' => 'description of something', 'hasParams' => false, 'memberOrder' => :integer, 'parameters' => {}, 'links' => [ { 'rel' => 'self', 'href' => 'http://localhost/domain-types/ActionTest/actions/do_something', 'type' => 'application/json;profile="urn:org.restfulobjects:repr-types/action-description"', 'method' => 'GET' }, { 'rel' => 'up', 'href' => 'http://localhost/domain-types/ActionTest', '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/int', 'type' => 'application/json;profile="urn:org.restfulobjects:repr-types/domain-type"', 'method' => 'GET' } ] } get '/domain-types/ActionTest/actions/do_something' 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_actions_spec.rb |