spec/integration/ip_messaging/v1/service/channel_spec.rb in twilio-ruby-5.0.0.rc18 vs spec/integration/ip_messaging/v1/service/channel_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 'Channel' do
it "can fetch" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
}.to raise_exception(Twilio::REST::TwilioException)
-
+
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'get',
url: 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
@@ -29,40 +29,44 @@
%q[
{
"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "friendly_name": "d816d8da-51c0-44e1-928a-44822f49bc95",
- "unique_name": "c64ad6b0-0090-4cfc-b574-b1ce5208ac0b",
- "attributes": null,
+ "friendly_name": "friendly_name",
+ "unique_name": "unique_name",
+ "attributes": "{ \\"foo\\": \\"bar\\" }",
"type": "public",
"date_created": "2015-12-16T22:18:37Z",
"date_updated": "2015-12-16T22:18:37Z",
"created_by": "system",
- "url": "https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "members_count": 0,
+ "messages_count": 0,
+ "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
- "members": "https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members",
- "messages": "https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages"
+ "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members",
+ "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
+ "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites",
+ "last_message": null
}
}
]
))
-
+
actual = @client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch()
-
+
expect(actual).to_not eq(nil)
end
it "can delete" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
}.to raise_exception(Twilio::REST::TwilioException)
-
+
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'delete',
url: 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
@@ -72,25 +76,25 @@
it "receives delete responses" do
@holodeck.mock(Twilio::TwilioResponse.new(
204,
nil,
))
-
+
actual = @client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").delete()
-
+
expect(actual).to eq(true)
end
it "can create" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels.create()
}.to raise_exception(Twilio::REST::TwilioException)
-
+
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'post',
url: 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels',
@@ -103,40 +107,44 @@
%q[
{
"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "friendly_name": "d816d8da-51c0-44e1-928a-44822f49bc95",
- "unique_name": "c64ad6b0-0090-4cfc-b574-b1ce5208ac0b",
- "attributes": null,
+ "friendly_name": "friendly_name",
+ "unique_name": "unique_name",
+ "attributes": "{ \\"foo\\": \\"bar\\" }",
"type": "public",
"date_created": "2015-12-16T22:18:37Z",
"date_updated": "2015-12-16T22:18:37Z",
"created_by": "system",
- "url": "https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "members_count": 0,
+ "messages_count": 0,
+ "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
- "members": "https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members",
- "messages": "https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages"
+ "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members",
+ "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
+ "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites",
+ "last_message": null
}
}
]
))
-
+
actual = @client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels.create()
-
+
expect(actual).to_not eq(nil)
end
it "can read" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels.list()
}.to raise_exception(Twilio::REST::TwilioException)
-
+
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'get',
url: 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels',
@@ -148,43 +156,47 @@
200,
%q[
{
"channels": [
{
- "sid": "CHc12e6f1419b244fe8da312bc2cdebebc",
+ "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "service_sid": "IS034e4a0c83f94e10a2ab4a3c19a16a86",
- "friendly_name": "d816d8da-51c0-44e1-928a-44822f49bc95",
- "unique_name": "c64ad6b0-0090-4cfc-b574-b1ce5208ac0b",
- "attributes": null,
+ "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "friendly_name",
+ "unique_name": "unique_name",
+ "attributes": "{ \\"foo\\": \\"bar\\" }",
"type": "public",
"date_created": "2015-12-16T22:18:37Z",
"date_updated": "2015-12-16T22:18:37Z",
"created_by": "system",
- "url": "https://ip-messaging.twilio.com/v1/Services/IS034e4a0c83f94e10a2ab4a3c19a16a86/Channels/CHc12e6f1419b244fe8da312bc2cdebebc",
+ "members_count": 0,
+ "messages_count": 0,
+ "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
- "members": "https://ip-messaging.twilio.com/v1/Services/IS034e4a0c83f94e10a2ab4a3c19a16a86/Channels/CHc12e6f1419b244fe8da312bc2cdebebc/Members",
- "messages": "https://ip-messaging.twilio.com/v1/Services/IS034e4a0c83f94e10a2ab4a3c19a16a86/Channels/CHc12e6f1419b244fe8da312bc2cdebebc/Messages"
+ "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members",
+ "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
+ "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites",
+ "last_message": null
}
}
],
"meta": {
"page": 0,
- "page_size": 1,
- "first_page_url": "https://ip-messaging.twilio.com/v1/Services/IS034e4a0c83f94e10a2ab4a3c19a16a86/Channels?PageSize=1&Page=0",
+ "page_size": 50,
+ "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0",
"previous_page_url": null,
- "url": "https://ip-messaging.twilio.com/v1/Services/IS034e4a0c83f94e10a2ab4a3c19a16a86/Channels?PageSize=1&Page=0",
+ "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0",
"next_page_url": null,
"key": "channels"
}
}
]
))
-
+
actual = @client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels.list()
-
+
expect(actual).to_not eq(nil)
end
it "receives read_empty responses" do
@holodeck.mock(Twilio::TwilioResponse.new(
@@ -192,35 +204,35 @@
%q[
{
"channels": [],
"meta": {
"page": 0,
- "page_size": 1,
- "first_page_url": "https://ip-messaging.twilio.com/v1/Services/IS034e4a0c83f94e10a2ab4a3c19a16a86/Channels?PageSize=1&Page=0",
+ "page_size": 50,
+ "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0",
"previous_page_url": null,
- "url": "https://ip-messaging.twilio.com/v1/Services/IS034e4a0c83f94e10a2ab4a3c19a16a86/Channels?PageSize=1&Page=0",
+ "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0",
"next_page_url": null,
"key": "channels"
}
}
]
))
-
+
actual = @client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels.list()
-
+
expect(actual).to_not eq(nil)
end
it "can update" do
@holodeck.mock(Twilio::TwilioResponse.new(500, ''))
-
+
expect {
@client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
}.to raise_exception(Twilio::REST::TwilioException)
-
+
values = {}
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'post',
url: 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
@@ -233,27 +245,31 @@
%q[
{
"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "friendly_name": "d816d8da-51c0-44e1-928a-44822f49bc95",
- "unique_name": "c64ad6b0-0090-4cfc-b574-b1ce5208ac0b",
- "attributes": null,
+ "friendly_name": "friendly_name",
+ "unique_name": "unique_name",
+ "attributes": "{ \\"foo\\": \\"bar\\" }",
"type": "public",
"date_created": "2015-12-16T22:18:37Z",
"date_updated": "2015-12-16T22:18:37Z",
"created_by": "system",
- "url": "https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "members_count": 0,
+ "messages_count": 0,
+ "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
- "members": "https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members",
- "messages": "https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages"
+ "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members",
+ "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
+ "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites",
+ "last_message": null
}
}
]
))
-
+
actual = @client.ip_messaging.v1.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \
.channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update()
-
+
expect(actual).to_not eq(nil)
end
end
\ No newline at end of file