spec/integration/api/v2010/account/usage/trigger_spec.rb in twilio-ruby-5.0.0.rc18 vs spec/integration/api/v2010/account/usage/trigger_spec.rb in twilio-ruby-5.0.0.rc19
- old
+ new
@@ -1,23 +1,23 @@
##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
-# / /
+# / /
require 'spec_helper.rb'
describe 'Trigger' do
it "can fetch" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
.triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
@@ -46,27 +46,27 @@
"usage_category": "totalprice",
"usage_record_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice"
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
.triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
-
+
expect(actual).to_not eq(nil)
end
it "can update" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
.triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
@@ -95,27 +95,27 @@
"usage_category": "totalprice",
"usage_record_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice"
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
.triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
-
+
expect(actual).to_not eq(nil)
end
it "can delete" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
.triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").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/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json',
@@ -125,31 +125,31 @@
it "receives delete responses" do
@holodeck.mock(Twilio::TwilioResponse.new(
204,
nil,
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
.triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
-
+
expect(actual).to eq(true)
end
it "can create" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
- .triggers.create(callback_url: "https://example.com", trigger_value: "trigger_value", usage_category: "authy-authentications")
+ .triggers.create(callback_url: "https://example.com", trigger_value: "trigger_value", usage_category: "answering-machine-detection")
}.to raise_exception(Twilio::REST::TwilioException)
-
+
values = {
'CallbackUrl' => "https://example.com",
'TriggerValue' => "trigger_value",
- 'UsageCategory' => "authy-authentications",
+ 'UsageCategory' => "answering-machine-detection",
}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'post',
url: 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers.json',
@@ -157,11 +157,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",
"callback_method": "GET",
@@ -179,27 +179,27 @@
"usage_category": "totalprice",
"usage_record_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice"
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
- .triggers.create(callback_url: "https://example.com", trigger_value: "trigger_value", usage_category: "authy-authentications")
-
+ .triggers.create(callback_url: "https://example.com", trigger_value: "trigger_value", usage_category: "answering-machine-detection")
+
expect(actual).to_not eq(nil)
end
it "can read" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
.triggers.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/Usage/Triggers.json',
@@ -243,15 +243,15 @@
}
]
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
.triggers.list()
-
+
expect(actual).to_not eq(nil)
end
it "receives read_empty responses" do
@holodeck.mock(Twilio::TwilioResponse.new(
@@ -271,13 +271,13 @@
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers",
"usage_triggers": []
}
]
))
-
+
actual = @client.api.v2010.accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.usage \
.triggers.list()
-
+
expect(actual).to_not eq(nil)
end
end
\ No newline at end of file