spec/integration/api/v2010/account/application_spec.rb in twilio-ruby-5.0.0.rc18 vs spec/integration/api/v2010/account/application_spec.rb in twilio-ruby-5.0.0.rc19
- old
+ new
@@ -1,22 +1,22 @@
##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
-# / /
+# / /
require 'spec_helper.rb'
describe 'Application' do
it "can create" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications.create(friendly_name: "friendly_name")
}.to raise_exception(Twilio::REST::TwilioException)
-
+
values = {
'FriendlyName' => "friendly_name",
}
expect(
@holodeck.has_request?(Holodeck::Request.new(
@@ -26,11 +26,11 @@
))).to eq(true)
end
it "receives create responses" do
@holodeck.mock(Twilio::TwilioResponse.new(
- 200,
+ 201,
%q[
{
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"api_version": "2010-04-01",
"date_created": "Mon, 22 Aug 2011 20:59:45 +0000",
@@ -52,25 +52,25 @@
"voice_method": "GET",
"voice_url": "http://example.com"
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications.create(friendly_name: "friendly_name")
-
+
expect(actual).to_not eq(nil)
end
it "can delete" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
}.to raise_exception(Twilio::REST::TwilioException)
-
+
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'delete',
url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
@@ -80,25 +80,25 @@
it "receives delete responses" do
@holodeck.mock(Twilio::TwilioResponse.new(
204,
nil,
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
-
+
expect(actual).to eq(true)
end
it "can fetch" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
@@ -131,25 +131,25 @@
"voice_method": "GET",
"voice_url": "http://example.com"
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
-
+
expect(actual).to_not eq(nil)
end
it "can read" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications.list()
}.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/Applications.json',
@@ -197,14 +197,14 @@
"total": 36,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0"
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications.list()
-
+
expect(actual).to_not eq(nil)
end
it "receives read_empty responses" do
@holodeck.mock(Twilio::TwilioResponse.new(
@@ -224,25 +224,25 @@
"total": 36,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0"
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications.list()
-
+
expect(actual).to_not eq(nil)
end
it "can update" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
@@ -275,12 +275,12 @@
"voice_method": "GET",
"voice_url": "http://example.com"
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
-
+
expect(actual).to_not eq(nil)
end
end
\ No newline at end of file