## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / require 'spec_helper.rb' describe 'Sim' do it "can fetch" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.wireless.v1.sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() }.to raise_exception(Twilio::REST::TwilioError) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'get', url: 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ))).to eq(true) end it "receives fetch responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "commands_callback_method": "http_method", "commands_callback_url": "http://www.example.com", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "sms_fallback_method": "http_method", "sms_fallback_url": "http://www.example.com", "sms_method": "http_method", "sms_url": "http://www.example.com", "voice_fallback_method": "http_method", "voice_fallback_url": "http://www.example.com", "voice_method": "http_method", "voice_url": "http://www.example.com", "links": { "rate_plan": "https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "usage_records": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords" }, "rate_plan_sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "iccid": "iccid", "e_id": "e_id", "status": "new", "url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] )) actual = @client.wireless.v1.sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch() expect(actual).to_not eq(nil) end it "can read" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.wireless.v1.sims.list() }.to raise_exception(Twilio::REST::TwilioError) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'get', url: 'https://wireless.twilio.com/v1/Sims', ))).to eq(true) end it "receives read_empty responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "sims": [], "meta": { "first_page_url": "https://wireless.twilio.com/v1/Sims?PageSize=50&Page=0", "key": "sims", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://wireless.twilio.com/v1/Sims?PageSize=50&Page=0" } } ] )) actual = @client.wireless.v1.sims.list() expect(actual).to_not eq(nil) end it "receives read_full responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "sims": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "commands_callback_method": "http_method", "commands_callback_url": "http://www.example.com", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "rate_plan": "https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "usage_records": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords" }, "rate_plan_sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "iccid": "iccid", "e_id": "e_id", "status": "new", "sms_fallback_method": "http_method", "sms_fallback_url": "http://www.example.com", "sms_method": "http_method", "sms_url": "http://www.example.com", "voice_fallback_method": "http_method", "voice_fallback_url": "http://www.example.com", "voice_method": "http_method", "voice_url": "http://www.example.com", "url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://wireless.twilio.com/v1/Sims?PageSize=50&Page=0", "key": "sims", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://wireless.twilio.com/v1/Sims?PageSize=50&Page=0" } } ] )) actual = @client.wireless.v1.sims.list() expect(actual).to_not eq(nil) end it "can update" do @holodeck.mock(Twilio::TwilioResponse.new(500, '')) expect { @client.wireless.v1.sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update() }.to raise_exception(Twilio::REST::TwilioError) values = {} expect( @holodeck.has_request?(Holodeck::Request.new( method: 'post', url: 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', ))).to eq(true) end it "receives update responses" do @holodeck.mock(Twilio::TwilioResponse.new( 200, %q[ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "commands_callback_method": "http_method", "commands_callback_url": "http://www.example.com", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "rate_plan": "https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "usage_records": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords" }, "rate_plan_sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "iccid": "iccid", "e_id": "e_id", "status": "new", "sms_fallback_method": "http_method", "sms_fallback_url": "http://www.example.com", "sms_method": "http_method", "sms_url": "http://www.example.com", "voice_fallback_method": "http_method", "voice_fallback_url": "http://www.example.com", "voice_method": "http_method", "voice_url": "http://www.example.com", "url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] )) actual = @client.wireless.v1.sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update() expect(actual).to_not eq(nil) end end