## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / require 'spec_helper.rb' describe 'Sandbox' do it "can fetch" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .sandbox().fetch() }.to raise_exception(Twilio::REST::TwilioException) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'get', url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sandbox.json', ))).to eq(true) end it "receives fetch responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "date_created": "Sun, 15 Mar 2009 02:08:47 +0000", "date_updated": "Fri, 18 Feb 2011 17:37:18 +0000", "phone_number": "4155992671", "pin": "66528411", "sms_method": "POST", "sms_url": "http://demo.twilio.com/welcome/sms", "status_callback": null, "status_callback_method": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sandbox.json", "voice_method": "POST", "voice_url": "http://www.digg.com" } ] )) actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .sandbox().fetch() expect(actual).to_not eq(nil) end it "can update" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .sandbox().update() }.to raise_exception(Twilio::REST::TwilioException) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'post', url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sandbox.json', ))).to eq(true) end it "receives update responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "application_sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "date_created": "Sun, 15 Mar 2009 02:08:47 +0000", "date_updated": "Fri, 18 Feb 2011 17:37:18 +0000", "phone_number": "4155992671", "pin": "66528411", "sms_method": "POST", "sms_url": "http://demo.twilio.com/welcome/sms", "status_callback": null, "status_callback_method": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sandbox.json", "voice_method": "POST", "voice_url": "http://www.digg.com" } ] )) actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \ .sandbox().update() expect(actual).to_not eq(nil) end end