## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true require 'spec_helper.rb' describe 'ExportCustomJob' do it "can read" do @holodeck.mock(Twilio::Response.new(500, '')) expect { @client.preview.bulk_exports.exports('resource_type') \ .export_custom_jobs.list() }.to raise_exception(Twilio::REST::TwilioError) expect( @holodeck.has_request?(Holodeck::Request.new( method: 'get', url: 'https://preview.twilio.com/BulkExports/Exports/resource_type/Jobs', ))).to eq(true) end it "receives read_empty responses" do @holodeck.mock(Twilio::Response.new( 200, %q[ { "meta": { "previous_page_url": null, "url": "https://preview.twilio.com/BulkExports/Exports/Messages/Jobs?PageSize=50&Page=0", "page_size": 50, "key": "jobs", "first_page_url": "https://preview.twilio.com/BulkExports/Exports/Messages/Jobs?PageSize=50&Page=0", "next_page_url": null, "page": 0 }, "jobs": [] } ] )) actual = @client.preview.bulk_exports.exports('resource_type') \ .export_custom_jobs.list() expect(actual).to_not eq(nil) end it "receives read_full responses" do @holodeck.mock(Twilio::Response.new( 200, %q[ { "meta": { "previous_page_url": null, "url": "https://preview.twilio.com/BulkExports/Exports/Messages/Jobs?PageSize=50&Page=0", "page_size": 50, "key": "jobs", "first_page_url": "https://preview.twilio.com/BulkExports/Exports/Messages/Jobs?PageSize=50&Page=0", "next_page_url": null, "page": 0 }, "jobs": [ { "start_day": "start_day", "job_sid": "JSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "webhook_method": "webhook_method", "details": {}, "end_day": "end_day", "webhook_url": "webhook_url", "email": "email", "resource_type": "resource_type" } ] } ] )) actual = @client.preview.bulk_exports.exports('resource_type') \ .export_custom_jobs.list() expect(actual).to_not eq(nil) end it "can create" do @holodeck.mock(Twilio::Response.new(500, '')) expect { @client.preview.bulk_exports.exports('resource_type') \ .export_custom_jobs.create() }.to raise_exception(Twilio::REST::TwilioError) expect( @holodeck.has_request?(Holodeck::Request.new( method: 'post', url: 'https://preview.twilio.com/BulkExports/Exports/resource_type/Jobs', ))).to eq(true) end it "receives create responses" do @holodeck.mock(Twilio::Response.new( 201, %q[ { "start_day": "start_day", "job_sid": "JSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "webhook_method": "webhook_method", "details": {}, "end_day": "end_day", "webhook_url": "webhook_url", "email": "email", "resource_type": "resource_type" } ] )) actual = @client.preview.bulk_exports.exports('resource_type') \ .export_custom_jobs.create() expect(actual).to_not eq(nil) end end