pubnub 4.4.0 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pubnub might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.pubnub.yml +18 -2
- data/.travis.yml +4 -2
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +10 -1
- data/README.md +56 -17
- data/VERSION +1 -1
- data/fixtures/vcr_cassettes/examples/add_channels_to_push/001.yml +45 -0
- data/fixtures/vcr_cassettes/examples/add_channels_to_push/002.yml +45 -0
- data/fixtures/vcr_cassettes/examples/add_channels_to_push/003.yml +45 -0
- data/fixtures/vcr_cassettes/examples/add_channels_to_push/004.yml +45 -0
- data/fixtures/vcr_cassettes/examples/grant/1946.yml +8 -9
- data/fixtures/vcr_cassettes/examples/grant/1947.yml +8 -9
- data/fixtures/vcr_cassettes/examples/grant/1948.yml +8 -9
- data/fixtures/vcr_cassettes/examples/list_push_provisions/001.yml +46 -0
- data/fixtures/vcr_cassettes/examples/list_push_provisions/002.yml +45 -0
- data/fixtures/vcr_cassettes/examples/list_push_provisions/003.yml +45 -0
- data/fixtures/vcr_cassettes/examples/remove_channels_from_push/001.yml +45 -0
- data/fixtures/vcr_cassettes/examples/remove_channels_from_push/002.yml +45 -0
- data/fixtures/vcr_cassettes/examples/remove_channels_from_push/003.yml +45 -0
- data/fixtures/vcr_cassettes/examples/remove_device_from_push/001.yml +45 -0
- data/fixtures/vcr_cassettes/examples/remove_device_from_push/002.yml +45 -0
- data/fixtures/vcr_cassettes/examples/remove_device_from_push/003.yml +45 -0
- data/fixtures/vcr_cassettes/lib/events/get_all_channels_metadata.yml +1 -1
- data/fixtures/vcr_cassettes/lib/events/get_channel_members.yml +1 -1
- data/fixtures/vcr_cassettes/lib/events/{get_memberships.yml → get_memberships1.yml} +1 -1
- data/fixtures/vcr_cassettes/lib/events/get_memberships2.yml +37 -0
- data/fixtures/vcr_cassettes/lib/events/{get_uuid_metadata.yml → get_uuid_metadata1.yml} +0 -0
- data/fixtures/vcr_cassettes/lib/events/get_uuid_metadata2.yml +76 -0
- data/fixtures/vcr_cassettes/lib/events/remove_channel_members.yml +1 -1
- data/fixtures/vcr_cassettes/lib/events/{remove_memberships.yml → remove_memberships1.yml} +0 -0
- data/fixtures/vcr_cassettes/lib/events/remove_memberships2.yml +39 -0
- data/fixtures/vcr_cassettes/lib/events/{remove_uuid_metadata.yml → remove_uuid_metadata1.yml} +0 -0
- data/fixtures/vcr_cassettes/lib/events/remove_uuid_metadata2.yml +76 -0
- data/fixtures/vcr_cassettes/lib/events/{set_memberships.yml → set_memberships1.yml} +0 -0
- data/fixtures/vcr_cassettes/lib/events/set_memberships2.yml +39 -0
- data/fixtures/vcr_cassettes/lib/events/{set_uuid_metadata.yml → set_uuid_metadata1.yml} +0 -0
- data/fixtures/vcr_cassettes/lib/events/set_uuid_metadata2.yml +78 -0
- data/lib/pubnub/client.rb +4 -1
- data/lib/pubnub/event.rb +3 -1
- data/lib/pubnub/events/add_channels_to_push.rb +29 -13
- data/lib/pubnub/events/get_all_channels_metadata.rb +13 -1
- data/lib/pubnub/events/get_all_uuid_metadata.rb +13 -1
- data/lib/pubnub/events/get_channel_members.rb +21 -1
- data/lib/pubnub/events/get_channel_metadata.rb +6 -1
- data/lib/pubnub/events/get_memberships.rb +22 -2
- data/lib/pubnub/events/get_uuid_metadata.rb +7 -2
- data/lib/pubnub/events/grant.rb +1 -1
- data/lib/pubnub/events/list_push_provisions.rb +29 -12
- data/lib/pubnub/events/remove_channel_members.rb +22 -2
- data/lib/pubnub/events/remove_channels_from_push.rb +29 -13
- data/lib/pubnub/events/remove_device_from_push.rb +30 -14
- data/lib/pubnub/events/remove_memberships.rb +23 -3
- data/lib/pubnub/events/remove_uuid_metadata.rb +1 -1
- data/lib/pubnub/events/set_channel_members.rb +21 -1
- data/lib/pubnub/events/set_channel_metadata.rb +6 -1
- data/lib/pubnub/events/set_memberships.rb +22 -2
- data/lib/pubnub/events/set_uuid_metadata.rb +7 -2
- data/lib/pubnub/formatter.rb +28 -1
- data/lib/pubnub/validators/add_channels_to_push.rb +52 -0
- data/lib/pubnub/validators/grant.rb +1 -1
- data/lib/pubnub/validators/list_push_provisions.rb +43 -0
- data/lib/pubnub/validators/remove_channels_from_push.rb +52 -0
- data/lib/pubnub/validators/remove_device_from_push.rb +43 -0
- data/lib/pubnub/version.rb +1 -1
- data/spec/examples/add_channels_to_push_spec.rb +178 -0
- data/spec/examples/{grant_examples_spec.rb → grant_examples_1_spec.rb} +0 -9009
- data/spec/examples/grant_examples_2_spec.rb +9107 -0
- data/spec/examples/list_push_provisions_spec.rb +164 -0
- data/spec/examples/presence_examples_spec.rb +222 -186
- data/spec/examples/remove_channels_from_push_spec.rb +164 -0
- data/spec/examples/remove_device_from_push_spec.rb +164 -0
- data/spec/examples/revoke_examples_1_spec.rb +27013 -0
- data/spec/examples/revoke_examples_2_spec.rb +27012 -0
- data/spec/examples/revoke_examples_3_spec.rb +17967 -0
- data/spec/examples/status_request_message_count_exceeded_spec.rb +4 -1
- data/spec/examples/subscribe_examples_1_spec.rb +26972 -0
- data/spec/examples/subscribe_examples_2_spec.rb +19575 -0
- data/spec/lib/connection_callback_spec.rb +4 -3
- data/spec/lib/events/membership_spec.rb +38 -11
- data/spec/lib/events/presence_delta_spec.rb +9 -6
- data/spec/lib/events/presence_spec.rb +13 -7
- data/spec/lib/events/subscribe_spec.rb +56 -32
- data/spec/lib/events/uuid_metadata_spec.rb +36 -6
- data/spec/lib/super_admin_spec.rb +8 -4
- data/spec/spec_helper.rb +23 -7
- metadata +53 -15
- data/lib/pubnub/validators/push.rb +0 -43
- data/spec/examples/revoke_examples_spec.rb +0 -71950
- data/spec/examples/subscribe_examples_spec.rb +0 -45184
@@ -0,0 +1,164 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Pubnub::ListPushProvisions do
|
4
|
+
around :each do |example|
|
5
|
+
@fired = false
|
6
|
+
|
7
|
+
@callback = -> (_envelope) do
|
8
|
+
@fired = true
|
9
|
+
end
|
10
|
+
|
11
|
+
@pubnub = Pubnub.new(
|
12
|
+
subscribe_key: 'sub-a-mock-key',
|
13
|
+
uuid: "ruby-test-uuid-client-one",
|
14
|
+
auth_key: "ruby-test-auth-client-one"
|
15
|
+
)
|
16
|
+
|
17
|
+
@device_token = '815ee724ccb0a6a84dc303be8ccbaa00d1c84dde6bcae6721b08f92100951113'
|
18
|
+
|
19
|
+
example.run_with_retry retry: 1
|
20
|
+
end
|
21
|
+
|
22
|
+
it "001_push_gateway___apns___push_token__valid___http_sync__true___callback__nil_" do
|
23
|
+
VCR.use_cassette("examples/list_push_provisions/001", record: :once) do
|
24
|
+
envelope = @pubnub.list_push_provisions(push_token: @device_token, push_gateway: 'apns', http_sync: true)
|
25
|
+
|
26
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
27
|
+
expect(envelope.error?).to eq false
|
28
|
+
|
29
|
+
expect(envelope.status[:code]).to eq(200)
|
30
|
+
expect(envelope.status[:operation]).to eq(:list_push_provisions)
|
31
|
+
expect(envelope.status[:category]).to eq(:ack)
|
32
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", auth_key: "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
33
|
+
|
34
|
+
expect(envelope.result[:code]).to eq(200)
|
35
|
+
expect(envelope.result[:operation]).to eq(:list_push_provisions)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it "001_push_gateway___apns___push_token__valid___http_sync__true___callback___block_" do
|
40
|
+
VCR.use_cassette("examples/list_push_provisions/001", record: :once) do
|
41
|
+
envelope = @pubnub.list_push_provisions(push_token: @device_token, push_gateway: 'apns', http_sync: true, &@callback)
|
42
|
+
|
43
|
+
expect(@fired).to eq true
|
44
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
45
|
+
expect(envelope.error?).to eq false
|
46
|
+
|
47
|
+
expect(envelope.status[:code]).to eq(200)
|
48
|
+
expect(envelope.status[:operation]).to eq(:list_push_provisions)
|
49
|
+
expect(envelope.status[:category]).to eq(:ack)
|
50
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", auth_key: "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
51
|
+
|
52
|
+
expect(envelope.result[:code]).to eq(200)
|
53
|
+
expect(envelope.result[:operation]).to eq(:list_push_provisions)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it "001_push_gateway___apns___push_token__valid___http_sync__true___callback___lambda_" do
|
58
|
+
VCR.use_cassette("examples/list_push_provisions/001", record: :once) do
|
59
|
+
envelope = @pubnub.list_push_provisions(push_token: @device_token, push_gateway: 'apns', http_sync: true, callback: @callback)
|
60
|
+
|
61
|
+
expect(@fired).to eq true
|
62
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
63
|
+
expect(envelope.error?).to eq false
|
64
|
+
|
65
|
+
expect(envelope.status[:code]).to eq(200)
|
66
|
+
expect(envelope.status[:operation]).to eq(:list_push_provisions)
|
67
|
+
expect(envelope.status[:category]).to eq(:ack)
|
68
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", auth_key: "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
69
|
+
|
70
|
+
expect(envelope.result[:code]).to eq(200)
|
71
|
+
expect(envelope.result[:operation]).to eq(:list_push_provisions)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
it "001_push_gateway___apns___push_token__valid___http_sync__false___callback__nil_" do
|
76
|
+
VCR.use_cassette("examples/list_push_provisions/001", record: :once) do
|
77
|
+
envelope = @pubnub.list_push_provisions(push_token: @device_token, push_gateway: 'apns', http_sync: false)
|
78
|
+
envelope = envelope.value
|
79
|
+
|
80
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
81
|
+
expect(envelope.error?).to eq false
|
82
|
+
|
83
|
+
expect(envelope.status[:code]).to eq(200)
|
84
|
+
expect(envelope.status[:operation]).to eq(:list_push_provisions)
|
85
|
+
expect(envelope.status[:category]).to eq(:ack)
|
86
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", auth_key: "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
87
|
+
|
88
|
+
expect(envelope.result[:code]).to eq(200)
|
89
|
+
expect(envelope.result[:operation]).to eq(:list_push_provisions)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
it "001_push_gateway___apns___push_token__valid___http_sync__false___callback___block_" do
|
94
|
+
VCR.use_cassette("examples/list_push_provisions/001", record: :once) do
|
95
|
+
envelope = @pubnub.list_push_provisions(push_token: @device_token, push_gateway: 'apns', http_sync: false, &@callback)
|
96
|
+
envelope = envelope.value
|
97
|
+
|
98
|
+
expect(@fired).to eq true
|
99
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
100
|
+
expect(envelope.error?).to eq false
|
101
|
+
|
102
|
+
expect(envelope.status[:code]).to eq(200)
|
103
|
+
expect(envelope.status[:operation]).to eq(:list_push_provisions)
|
104
|
+
expect(envelope.status[:category]).to eq(:ack)
|
105
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", auth_key: "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
106
|
+
|
107
|
+
expect(envelope.result[:code]).to eq(200)
|
108
|
+
expect(envelope.result[:operation]).to eq(:list_push_provisions)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
it "001_push_gateway___apns___push_token__valid___http_sync__false___callback___lambda_" do
|
113
|
+
VCR.use_cassette("examples/list_push_provisions/001", record: :once) do
|
114
|
+
envelope = @pubnub.list_push_provisions(push_token: @device_token, push_gateway: 'apns', http_sync: false, callback: @callback)
|
115
|
+
envelope = envelope.value
|
116
|
+
|
117
|
+
expect(@fired).to eq true
|
118
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
119
|
+
expect(envelope.error?).to eq false
|
120
|
+
|
121
|
+
expect(envelope.status[:code]).to eq(200)
|
122
|
+
expect(envelope.status[:operation]).to eq(:list_push_provisions)
|
123
|
+
expect(envelope.status[:category]).to eq(:ack)
|
124
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", auth_key: "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
125
|
+
|
126
|
+
expect(envelope.result[:code]).to eq(200)
|
127
|
+
expect(envelope.result[:operation]).to eq(:list_push_provisions)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
it "002_push_gateway___apns2___push_token__valid___topic__ruby_test___environment__default___http_sync__true___callback__nil_" do
|
132
|
+
VCR.use_cassette("examples/list_push_provisions/002", record: :once) do
|
133
|
+
envelope = @pubnub.list_push_provisions(push_token: @device_token, push_gateway: 'apns2', topic: 'ruby_test', http_sync: true)
|
134
|
+
|
135
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
136
|
+
expect(envelope.error?).to eq false
|
137
|
+
|
138
|
+
expect(envelope.status[:code]).to eq(200)
|
139
|
+
expect(envelope.status[:operation]).to eq(:list_push_provisions)
|
140
|
+
expect(envelope.status[:category]).to eq(:ack)
|
141
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", auth_key: "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
142
|
+
|
143
|
+
expect(envelope.result[:code]).to eq(200)
|
144
|
+
expect(envelope.result[:operation]).to eq(:list_push_provisions)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
it "003_push_gateway___apns2___push_token__valid___topic__ruby_test___environment__production___http_sync__true___callback__nil_" do
|
149
|
+
VCR.use_cassette("examples/list_push_provisions/003", record: :once) do
|
150
|
+
envelope = @pubnub.list_push_provisions(push_token: @device_token, push_gateway: 'apns2', topic: 'ruby_test', environment: 'production', http_sync: true)
|
151
|
+
|
152
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
153
|
+
expect(envelope.error?).to eq false
|
154
|
+
|
155
|
+
expect(envelope.status[:code]).to eq(200)
|
156
|
+
expect(envelope.status[:operation]).to eq(:list_push_provisions)
|
157
|
+
expect(envelope.status[:category]).to eq(:ack)
|
158
|
+
expect(envelope.status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", auth_key: "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
159
|
+
|
160
|
+
expect(envelope.result[:code]).to eq(200)
|
161
|
+
expect(envelope.result[:operation]).to eq(:list_push_provisions)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
@@ -110,14 +110,17 @@ describe Pubnub::Presence do
|
|
110
110
|
end
|
111
111
|
|
112
112
|
eventually do
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
113
|
+
if @status_envelopes.length > 0
|
114
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
115
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
116
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
117
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
118
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
119
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
120
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
121
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
122
|
+
true
|
123
|
+
end
|
121
124
|
end
|
122
125
|
end
|
123
126
|
|
@@ -137,23 +140,26 @@ describe Pubnub::Presence do
|
|
137
140
|
end
|
138
141
|
|
139
142
|
eventually do
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
143
|
+
if @status_envelopes.length >= 1
|
144
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
145
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
146
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
147
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
148
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
149
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
150
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
151
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
152
|
+
|
153
|
+
expect(@status_envelopes[1].status[:category]).to eq(:timeout)
|
154
|
+
expect(@status_envelopes[1].status[:error]).to eq(true)
|
155
|
+
expect(@status_envelopes[1].status[:auto_retried]).to eq(true)
|
156
|
+
expect(@status_envelopes[1].status[:current_timetoken]).to eq(0)
|
157
|
+
expect(@status_envelopes[1].status[:last_timetoken]).to eq(0)
|
158
|
+
expect(@status_envelopes[1].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
159
|
+
expect(@status_envelopes[1].status[:subscribed_channel_groups]).to eq([])
|
160
|
+
expect(@status_envelopes[1].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
161
|
+
true
|
162
|
+
end
|
157
163
|
end
|
158
164
|
end
|
159
165
|
|
@@ -173,23 +179,26 @@ describe Pubnub::Presence do
|
|
173
179
|
end
|
174
180
|
|
175
181
|
eventually do
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
182
|
+
if @status_envelopes.length >= 1
|
183
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
184
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
185
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
186
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
187
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
188
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
189
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
190
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
191
|
+
|
192
|
+
expect(@status_envelopes[1].status[:category]).to eq(:timeout)
|
193
|
+
expect(@status_envelopes[1].status[:error]).to eq(true)
|
194
|
+
expect(@status_envelopes[1].status[:auto_retried]).to eq(true)
|
195
|
+
expect(@status_envelopes[1].status[:current_timetoken]).to eq(0)
|
196
|
+
expect(@status_envelopes[1].status[:last_timetoken]).to eq(0)
|
197
|
+
expect(@status_envelopes[1].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
198
|
+
expect(@status_envelopes[1].status[:subscribed_channel_groups]).to eq([])
|
199
|
+
expect(@status_envelopes[1].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
200
|
+
true
|
201
|
+
end
|
193
202
|
end
|
194
203
|
end
|
195
204
|
|
@@ -284,14 +293,17 @@ describe Pubnub::Presence do
|
|
284
293
|
end
|
285
294
|
|
286
295
|
eventually do
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
296
|
+
if @status_envelopes.length > 0
|
297
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
298
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
299
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
300
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
301
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
302
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo.*-pnpres"])
|
303
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
304
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
305
|
+
true
|
306
|
+
end
|
295
307
|
end
|
296
308
|
end
|
297
309
|
|
@@ -311,23 +323,26 @@ describe Pubnub::Presence do
|
|
311
323
|
end
|
312
324
|
|
313
325
|
eventually do
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
326
|
+
if @status_envelopes.length >= 1
|
327
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
328
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
329
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
330
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
331
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
332
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo.*-pnpres"])
|
333
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
334
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
335
|
+
|
336
|
+
expect(@status_envelopes[1].status[:category]).to eq(:timeout)
|
337
|
+
expect(@status_envelopes[1].status[:error]).to eq(true)
|
338
|
+
expect(@status_envelopes[1].status[:auto_retried]).to eq(true)
|
339
|
+
expect(@status_envelopes[1].status[:current_timetoken]).to eq(0)
|
340
|
+
expect(@status_envelopes[1].status[:last_timetoken]).to eq(0)
|
341
|
+
expect(@status_envelopes[1].status[:subscribed_channels]).to eq(["demo.*-pnpres"])
|
342
|
+
expect(@status_envelopes[1].status[:subscribed_channel_groups]).to eq([])
|
343
|
+
expect(@status_envelopes[1].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
344
|
+
true
|
345
|
+
end
|
331
346
|
end
|
332
347
|
end
|
333
348
|
|
@@ -347,23 +362,26 @@ describe Pubnub::Presence do
|
|
347
362
|
end
|
348
363
|
|
349
364
|
eventually do
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
365
|
+
if @status_envelopes.length >= 1
|
366
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
367
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
368
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
369
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
370
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
371
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo.*-pnpres"])
|
372
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
373
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
374
|
+
|
375
|
+
expect(@status_envelopes[1].status[:category]).to eq(:timeout)
|
376
|
+
expect(@status_envelopes[1].status[:error]).to eq(true)
|
377
|
+
expect(@status_envelopes[1].status[:auto_retried]).to eq(true)
|
378
|
+
expect(@status_envelopes[1].status[:current_timetoken]).to eq(0)
|
379
|
+
expect(@status_envelopes[1].status[:last_timetoken]).to eq(0)
|
380
|
+
expect(@status_envelopes[1].status[:subscribed_channels]).to eq(["demo.*-pnpres"])
|
381
|
+
expect(@status_envelopes[1].status[:subscribed_channel_groups]).to eq([])
|
382
|
+
expect(@status_envelopes[1].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
383
|
+
true
|
384
|
+
end
|
367
385
|
end
|
368
386
|
end
|
369
387
|
|
@@ -458,14 +476,17 @@ describe Pubnub::Presence do
|
|
458
476
|
end
|
459
477
|
|
460
478
|
eventually do
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
479
|
+
if @status_envelopes.length > 0
|
480
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
481
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
482
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
483
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
484
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
485
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
486
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
487
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
488
|
+
true
|
489
|
+
end
|
469
490
|
end
|
470
491
|
end
|
471
492
|
|
@@ -485,23 +506,26 @@ describe Pubnub::Presence do
|
|
485
506
|
end
|
486
507
|
|
487
508
|
eventually do
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
509
|
+
if @status_envelopes.length >= 1
|
510
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
511
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
512
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
513
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
514
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
515
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
516
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
517
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
518
|
+
|
519
|
+
expect(@status_envelopes[1].status[:category]).to eq(:timeout)
|
520
|
+
expect(@status_envelopes[1].status[:error]).to eq(true)
|
521
|
+
expect(@status_envelopes[1].status[:auto_retried]).to eq(true)
|
522
|
+
expect(@status_envelopes[1].status[:current_timetoken]).to eq(0)
|
523
|
+
expect(@status_envelopes[1].status[:last_timetoken]).to eq(0)
|
524
|
+
expect(@status_envelopes[1].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
525
|
+
expect(@status_envelopes[1].status[:subscribed_channel_groups]).to eq([])
|
526
|
+
expect(@status_envelopes[1].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
527
|
+
true
|
528
|
+
end
|
505
529
|
end
|
506
530
|
end
|
507
531
|
|
@@ -521,23 +545,26 @@ describe Pubnub::Presence do
|
|
521
545
|
end
|
522
546
|
|
523
547
|
eventually do
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
548
|
+
if @status_envelopes.length >= 1
|
549
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
550
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
551
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
552
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
553
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
554
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
555
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
556
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
557
|
+
|
558
|
+
expect(@status_envelopes[1].status[:category]).to eq(:timeout)
|
559
|
+
expect(@status_envelopes[1].status[:error]).to eq(true)
|
560
|
+
expect(@status_envelopes[1].status[:auto_retried]).to eq(true)
|
561
|
+
expect(@status_envelopes[1].status[:current_timetoken]).to eq(0)
|
562
|
+
expect(@status_envelopes[1].status[:last_timetoken]).to eq(0)
|
563
|
+
expect(@status_envelopes[1].status[:subscribed_channels]).to eq(["demo-pnpres"])
|
564
|
+
expect(@status_envelopes[1].status[:subscribed_channel_groups]).to eq([])
|
565
|
+
expect(@status_envelopes[1].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
566
|
+
true
|
567
|
+
end
|
541
568
|
end
|
542
569
|
end
|
543
570
|
|
@@ -632,14 +659,17 @@ describe Pubnub::Presence do
|
|
632
659
|
end
|
633
660
|
|
634
661
|
eventually do
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
662
|
+
if @status_envelopes.length > 0
|
663
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
664
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
665
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
666
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
667
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
668
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo-pnpres", "demo.*-pnpres"])
|
669
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
670
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
671
|
+
true
|
672
|
+
end
|
643
673
|
end
|
644
674
|
end
|
645
675
|
|
@@ -659,32 +689,35 @@ describe Pubnub::Presence do
|
|
659
689
|
end
|
660
690
|
|
661
691
|
eventually do
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
692
|
+
if @status_envelopes.length >= 3
|
693
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
694
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
695
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
696
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
697
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
698
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo-pnpres", "demo.*-pnpres"])
|
699
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
700
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
701
|
+
|
702
|
+
expect(@status_envelopes[1].status[:category]).to eq(:timeout)
|
703
|
+
expect(@status_envelopes[1].status[:error]).to eq(true)
|
704
|
+
expect(@status_envelopes[1].status[:auto_retried]).to eq(true)
|
705
|
+
expect(@status_envelopes[1].status[:current_timetoken]).to eq(0)
|
706
|
+
expect(@status_envelopes[1].status[:last_timetoken]).to eq(0)
|
707
|
+
expect(@status_envelopes[1].status[:subscribed_channels]).to eq(["demo-pnpres", "demo.*-pnpres"])
|
708
|
+
expect(@status_envelopes[1].status[:subscribed_channel_groups]).to eq([])
|
709
|
+
expect(@status_envelopes[1].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
710
|
+
|
711
|
+
expect(@status_envelopes[2].status[:category]).to eq(:timeout)
|
712
|
+
expect(@status_envelopes[2].status[:error]).to eq(true)
|
713
|
+
expect(@status_envelopes[2].status[:auto_retried]).to eq(true)
|
714
|
+
expect(@status_envelopes[2].status[:current_timetoken]).to eq(0)
|
715
|
+
expect(@status_envelopes[2].status[:last_timetoken]).to eq(0)
|
716
|
+
expect(@status_envelopes[2].status[:subscribed_channels]).to eq(["demo-pnpres", "demo.*-pnpres"])
|
717
|
+
expect(@status_envelopes[2].status[:subscribed_channel_groups]).to eq([])
|
718
|
+
expect(@status_envelopes[2].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
719
|
+
true
|
720
|
+
end
|
688
721
|
end
|
689
722
|
end
|
690
723
|
|
@@ -704,32 +737,35 @@ describe Pubnub::Presence do
|
|
704
737
|
end
|
705
738
|
|
706
739
|
eventually do
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
740
|
+
if @status_envelopes.length >= 3
|
741
|
+
expect(@status_envelopes[0].status[:category]).to eq(:timeout)
|
742
|
+
expect(@status_envelopes[0].status[:error]).to eq(true)
|
743
|
+
expect(@status_envelopes[0].status[:auto_retried]).to eq(true)
|
744
|
+
expect(@status_envelopes[0].status[:current_timetoken]).to eq(0)
|
745
|
+
expect(@status_envelopes[0].status[:last_timetoken]).to eq(0)
|
746
|
+
expect(@status_envelopes[0].status[:subscribed_channels]).to eq(["demo-pnpres", "demo.*-pnpres"])
|
747
|
+
expect(@status_envelopes[0].status[:subscribed_channel_groups]).to eq([])
|
748
|
+
expect(@status_envelopes[0].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
749
|
+
|
750
|
+
expect(@status_envelopes[1].status[:category]).to eq(:timeout)
|
751
|
+
expect(@status_envelopes[1].status[:error]).to eq(true)
|
752
|
+
expect(@status_envelopes[1].status[:auto_retried]).to eq(true)
|
753
|
+
expect(@status_envelopes[1].status[:current_timetoken]).to eq(0)
|
754
|
+
expect(@status_envelopes[1].status[:last_timetoken]).to eq(0)
|
755
|
+
expect(@status_envelopes[1].status[:subscribed_channels]).to eq(["demo-pnpres", "demo.*-pnpres"])
|
756
|
+
expect(@status_envelopes[1].status[:subscribed_channel_groups]).to eq([])
|
757
|
+
expect(@status_envelopes[1].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
758
|
+
|
759
|
+
expect(@status_envelopes[2].status[:category]).to eq(:timeout)
|
760
|
+
expect(@status_envelopes[2].status[:error]).to eq(true)
|
761
|
+
expect(@status_envelopes[2].status[:auto_retried]).to eq(true)
|
762
|
+
expect(@status_envelopes[2].status[:current_timetoken]).to eq(0)
|
763
|
+
expect(@status_envelopes[2].status[:last_timetoken]).to eq(0)
|
764
|
+
expect(@status_envelopes[2].status[:subscribed_channels]).to eq(["demo-pnpres", "demo.*-pnpres"])
|
765
|
+
expect(@status_envelopes[2].status[:subscribed_channel_groups]).to eq([])
|
766
|
+
expect(@status_envelopes[2].status[:config]).to eq({:tls => false, :uuid => "ruby-test-uuid-client-one", :auth_key => "ruby-test-auth-client-one", :origin => "ps.pndsn.com"})
|
767
|
+
true
|
768
|
+
end
|
733
769
|
end
|
734
770
|
end
|
735
771
|
end
|