## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / require 'spec_helper.rb' describe 'Service' do it "can fetch" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.preview.sync.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() }.to raise_exception(Twilio::REST::TwilioError) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'get', url: 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ))).to eq(true) end it "receives fetch responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": false } ] )) actual = @client.preview.sync.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() expect(actual).to_not eq(nil) end it "can delete" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.preview.sync.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete() }.to raise_exception(Twilio::REST::TwilioError) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'delete', url: 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ))).to eq(true) end it "receives delete responses" do @holodeck.mock(Twilio::TwilioResponse.new( 204, nil, )) actual = @client.preview.sync.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete() expect(actual).to eq(true) end it "can create" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.preview.sync.services.create() }.to raise_exception(Twilio::REST::TwilioError) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'post', url: 'https://preview.twilio.com/Sync/Services', ))).to eq(true) end it "receives create responses" do @holodeck.mock(Twilio::TwilioResponse.new( 201, %q[ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": true } ] )) actual = @client.preview.sync.services.create() expect(actual).to_not eq(nil) end it "can read" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.preview.sync.services.list() }.to raise_exception(Twilio::REST::TwilioError) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'get', url: 'https://preview.twilio.com/Sync/Services', ))).to eq(true) end it "receives read_empty responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services?PageSize=50&Page=0", "key": "services", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services?PageSize=50&Page=0" }, "services": [] } ] )) actual = @client.preview.sync.services.list() expect(actual).to_not eq(nil) end it "receives read_full responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services?PageSize=50&Page=0", "key": "services", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services?PageSize=50&Page=0" }, "services": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": false } ] } ] )) actual = @client.preview.sync.services.list() expect(actual).to_not eq(nil) end it "can update" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.preview.sync.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update() }.to raise_exception(Twilio::REST::TwilioError) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'post', url: 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ))).to eq(true) end it "receives update responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": true } ] )) actual = @client.preview.sync.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update() expect(actual).to_not eq(nil) end end