pubnub 4.2.6 → 4.6.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/.github/CODEOWNERS +1 -0
- data/.pubnub.yml +113 -56
- data/.travis.yml +4 -2
- data/CHANGELOG.md +39 -11
- 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/channel_members/001.yml +111 -0
- data/fixtures/vcr_cassettes/examples/channel_members/002.yml +111 -0
- data/fixtures/vcr_cassettes/examples/channel_members/003.yml +111 -0
- data/fixtures/vcr_cassettes/examples/channel_members/004.yml +147 -0
- data/fixtures/vcr_cassettes/examples/channel_members/005.yml +147 -0
- data/fixtures/vcr_cassettes/examples/channel_members/006.yml +147 -0
- data/fixtures/vcr_cassettes/examples/channel_metadata/001.yml +39 -0
- data/fixtures/vcr_cassettes/examples/channel_metadata/002.yml +39 -0
- data/fixtures/vcr_cassettes/examples/channel_metadata/003.yml +39 -0
- data/fixtures/vcr_cassettes/examples/channel_metadata/004.yml +73 -0
- data/fixtures/vcr_cassettes/examples/channel_metadata/005.yml +73 -0
- data/fixtures/vcr_cassettes/examples/channel_metadata/006.yml +73 -0
- data/fixtures/vcr_cassettes/examples/grant/1913.yml +1 -1
- data/fixtures/vcr_cassettes/examples/grant/1944.yml +8 -9
- data/fixtures/vcr_cassettes/examples/grant/1945.yml +359 -9
- 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/history/include_meta__encrypted.yml +7 -7
- data/fixtures/vcr_cassettes/examples/history/include_meta__encrypted_random_iv.yml +46 -0
- data/fixtures/vcr_cassettes/examples/history/include_token__encrypted.yml +6 -6
- data/fixtures/vcr_cassettes/examples/history/include_token__encrypted_random_iv.yml +46 -0
- data/fixtures/vcr_cassettes/examples/history/no_includes__encrypted.yml +6 -6
- data/fixtures/vcr_cassettes/examples/history/no_includes__encrypted_random_iv.yml +45 -0
- 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/memberships/001.yml +111 -0
- data/fixtures/vcr_cassettes/examples/memberships/002.yml +111 -0
- data/fixtures/vcr_cassettes/examples/memberships/003.yml +111 -0
- data/fixtures/vcr_cassettes/examples/memberships/004.yml +111 -0
- data/fixtures/vcr_cassettes/examples/memberships/005.yml +147 -0
- data/fixtures/vcr_cassettes/examples/memberships/006.yml +147 -0
- data/fixtures/vcr_cassettes/examples/memberships/007.yml +147 -0
- data/fixtures/vcr_cassettes/examples/memberships/008.yml +147 -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/examples/uuid_metadata/001.yml +39 -0
- data/fixtures/vcr_cassettes/examples/uuid_metadata/002.yml +39 -0
- data/fixtures/vcr_cassettes/examples/uuid_metadata/003.yml +39 -0
- data/fixtures/vcr_cassettes/examples/uuid_metadata/004.yml +39 -0
- data/fixtures/vcr_cassettes/examples/uuid_metadata/005.yml +73 -0
- data/fixtures/vcr_cassettes/examples/uuid_metadata/006.yml +73 -0
- data/fixtures/vcr_cassettes/examples/uuid_metadata/007.yml +73 -0
- data/fixtures/vcr_cassettes/examples/uuid_metadata/008.yml +73 -0
- data/fixtures/vcr_cassettes/lib/events/get_all_channels_metadata.yml +39 -0
- data/fixtures/vcr_cassettes/lib/events/get_all_uuid_metadata.yml +76 -0
- data/fixtures/vcr_cassettes/lib/events/get_channel_members.yml +37 -0
- data/fixtures/vcr_cassettes/lib/events/get_channel_metadata.yml +37 -0
- data/fixtures/vcr_cassettes/lib/events/get_memberships1.yml +37 -0
- data/fixtures/vcr_cassettes/lib/events/get_memberships2.yml +37 -0
- data/fixtures/vcr_cassettes/lib/events/get_uuid_metadata1.yml +76 -0
- data/fixtures/vcr_cassettes/lib/events/get_uuid_metadata2.yml +76 -0
- data/fixtures/vcr_cassettes/lib/events/grant-error.yml +2 -2
- data/fixtures/vcr_cassettes/lib/events/grant.yml +10 -11
- data/fixtures/vcr_cassettes/lib/events/remove_channel_members.yml +78 -0
- data/fixtures/vcr_cassettes/lib/events/{delete_space.yml → remove_channel_metadata.yml} +5 -6
- data/fixtures/vcr_cassettes/lib/events/{manage_memberships_remove.yml → remove_memberships1.yml} +8 -9
- data/fixtures/vcr_cassettes/lib/events/{manage_members_add.yml → remove_memberships2.yml} +8 -9
- data/fixtures/vcr_cassettes/lib/events/remove_uuid_metadata1.yml +76 -0
- data/fixtures/vcr_cassettes/lib/events/remove_uuid_metadata2.yml +76 -0
- data/fixtures/vcr_cassettes/lib/events/set_channel_members.yml +39 -0
- data/fixtures/vcr_cassettes/lib/events/set_channel_metadata.yml +39 -0
- data/fixtures/vcr_cassettes/lib/events/{manage_memberships_add.yml → set_memberships1.yml} +8 -9
- data/fixtures/vcr_cassettes/lib/events/set_memberships2.yml +39 -0
- data/fixtures/vcr_cassettes/lib/events/set_uuid_metadata1.yml +78 -0
- data/fixtures/vcr_cassettes/lib/events/set_uuid_metadata2.yml +78 -0
- data/fixtures/vcr_cassettes/lib/events/{subscribe-space-delete-async.yml → subscribe-channel-metadata-remove-sync.yml} +12 -14
- data/fixtures/vcr_cassettes/lib/events/subscribe-channel-metadata-set-async.yml +75 -0
- data/fixtures/vcr_cassettes/lib/events/{subscribe-member-remove-async.yml → subscribe-member-remove-sync.yml} +12 -14
- data/fixtures/vcr_cassettes/lib/events/subscribe-member-set-async.yml +75 -0
- data/fixtures/vcr_cassettes/lib/events/subscribe-membership-remove-async.yml +12 -14
- data/fixtures/vcr_cassettes/lib/events/{subscribe-user-update-async.yml → subscribe-membership-set-async.yml} +12 -14
- data/fixtures/vcr_cassettes/lib/events/{subscribe-user-delete-async.yml → subscribe-uuid-metadata-remove-sync.yml} +12 -14
- data/fixtures/vcr_cassettes/lib/events/subscribe-uuid-metadata-set-async.yml +75 -0
- data/lib/pubnub/client.rb +22 -16
- data/lib/pubnub/client/events.rb +4 -2
- data/lib/pubnub/client/helpers.rb +1 -1
- data/lib/pubnub/configuration.rb +1 -0
- data/lib/pubnub/constants.rb +20 -18
- data/lib/pubnub/crypto.rb +22 -8
- data/lib/pubnub/event.rb +39 -17
- data/lib/pubnub/event/formatter.rb +4 -0
- data/lib/pubnub/event/signature.rb +22 -7
- data/lib/pubnub/events/add_channels_to_push.rb +29 -13
- data/lib/pubnub/events/get_all_channels_metadata.rb +104 -0
- data/lib/pubnub/events/get_all_uuid_metadata.rb +104 -0
- data/lib/pubnub/events/get_channel_members.rb +120 -0
- data/lib/pubnub/events/{update_space.rb → get_channel_metadata.rb} +27 -27
- data/lib/pubnub/events/get_memberships.rb +120 -0
- data/lib/pubnub/events/{create_space.rb → get_uuid_metadata.rb} +27 -25
- data/lib/pubnub/events/grant.rb +10 -1
- data/lib/pubnub/events/history.rb +2 -1
- data/lib/pubnub/events/list_push_provisions.rb +29 -12
- data/lib/pubnub/events/publish.rb +2 -2
- data/lib/pubnub/events/remove_channel_members.rb +137 -0
- data/lib/pubnub/events/{delete_space.rb → remove_channel_metadata.rb} +13 -13
- 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 +137 -0
- data/lib/pubnub/events/{delete_user.rb → remove_uuid_metadata.rb} +13 -13
- data/lib/pubnub/events/set_channel_members.rb +140 -0
- data/lib/pubnub/events/{manage_members.rb → set_channel_metadata.rb} +32 -38
- data/lib/pubnub/events/set_memberships.rb +140 -0
- data/lib/pubnub/events/{create_user.rb → set_uuid_metadata.rb} +33 -17
- data/lib/pubnub/events/signal.rb +1 -1
- data/lib/pubnub/formatter.rb +31 -4
- data/lib/pubnub/pam.rb +2 -11
- data/lib/pubnub/subscribe_callback.rb +1 -3
- data/lib/pubnub/subscribe_event/formatter.rb +30 -19
- data/lib/pubnub/subscriber.rb +5 -6
- data/lib/pubnub/validators/add_channels_to_push.rb +52 -0
- data/lib/pubnub/validators/get_all_channels_metadata.rb +29 -0
- data/lib/pubnub/validators/get_all_uuid_metadata.rb +29 -0
- data/lib/pubnub/validators/get_channel_members.rb +39 -0
- data/lib/pubnub/validators/get_channel_metadata.rb +39 -0
- data/lib/pubnub/validators/get_memberships.rb +39 -0
- data/lib/pubnub/validators/get_uuid_metadata.rb +39 -0
- data/lib/pubnub/validators/grant.rb +37 -2
- data/lib/pubnub/validators/list_push_provisions.rb +43 -0
- data/lib/pubnub/validators/remove_channel_members.rb +52 -0
- data/lib/pubnub/validators/remove_channel_metadata.rb +39 -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/validators/remove_memberships.rb +52 -0
- data/lib/pubnub/validators/remove_uuid_metadata.rb +39 -0
- data/lib/pubnub/validators/set_channel_members.rb +78 -0
- data/lib/pubnub/validators/set_channel_metadata.rb +62 -0
- data/lib/pubnub/validators/set_memberships.rb +78 -0
- data/lib/pubnub/validators/set_uuid_metadata.rb +62 -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 -8973
- data/spec/examples/grant_examples_2_spec.rb +9107 -0
- data/spec/examples/history_examples_spec.rb +87 -9
- data/spec/examples/list_push_provisions_spec.rb +164 -0
- data/spec/examples/presence_examples_spec.rb +222 -186
- data/spec/examples/publish_examples_spec.rb +864 -0
- data/spec/examples/remove_channel_members_examples_spec.rb +100 -0
- data/spec/examples/remove_channel_metadata_examples_spec.rb +89 -0
- 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/remove_memberships_examples_spec.rb +121 -0
- data/spec/examples/remove_uuid_metadata_examples_spec.rb +107 -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/set_channel_members_examples_spec.rb +99 -0
- data/spec/examples/set_channel_metadata_examples_spec.rb +93 -0
- data/spec/examples/set_memberships_examples_spec.rb +122 -0
- data/spec/examples/set_uuid_metadata_examples_spec.rb +114 -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/event/formatter_spec.rb +22 -0
- data/spec/lib/events/channel_metadata_spec.rb +58 -0
- data/spec/lib/events/grant_spec.rb +3 -2
- data/spec/lib/events/membership_spec.rb +51 -21
- 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 +104 -65
- data/spec/lib/events/uuid_metadata_spec.rb +86 -0
- data/spec/lib/multiple_ciphers_spec.rb +16 -4
- data/spec/lib/subscribe_event/formatter_spec.rb +22 -0
- data/spec/lib/super_admin_spec.rb +8 -4
- data/spec/spec_helper.rb +24 -8
- metadata +153 -65
- data/fixtures/vcr_cassettes/lib/events/create_space.yml +0 -40
- data/fixtures/vcr_cassettes/lib/events/create_user.yml +0 -40
- data/fixtures/vcr_cassettes/lib/events/delete_user.yml +0 -38
- data/fixtures/vcr_cassettes/lib/events/get_members.yml +0 -38
- data/fixtures/vcr_cassettes/lib/events/get_space.yml +0 -38
- data/fixtures/vcr_cassettes/lib/events/get_space_memberships.yml +0 -38
- data/fixtures/vcr_cassettes/lib/events/get_spaces.yml +0 -40
- data/fixtures/vcr_cassettes/lib/events/get_user.yml +0 -38
- data/fixtures/vcr_cassettes/lib/events/get_users.yml +0 -40
- data/fixtures/vcr_cassettes/lib/events/manage_members_remove.yml +0 -83
- data/fixtures/vcr_cassettes/lib/events/subscribe-member-add-async.yml +0 -77
- data/fixtures/vcr_cassettes/lib/events/subscribe-membership-add-async.yml +0 -77
- data/fixtures/vcr_cassettes/lib/events/subscribe-space-update-async.yml +0 -77
- data/fixtures/vcr_cassettes/lib/events/update_space.yml +0 -40
- data/fixtures/vcr_cassettes/lib/events/update_user.yml +0 -40
- data/lib/pubnub/events/get_members.rb +0 -93
- data/lib/pubnub/events/get_space.rb +0 -74
- data/lib/pubnub/events/get_space_memberships.rb +0 -93
- data/lib/pubnub/events/get_spaces.rb +0 -90
- data/lib/pubnub/events/get_user.rb +0 -74
- data/lib/pubnub/events/get_users.rb +0 -90
- data/lib/pubnub/events/manage_memberships.rb +0 -105
- data/lib/pubnub/events/update_user.rb +0 -86
- data/lib/pubnub/validators/create_space.rb +0 -44
- data/lib/pubnub/validators/create_user.rb +0 -44
- data/lib/pubnub/validators/delete_space.rb +0 -32
- data/lib/pubnub/validators/delete_user.rb +0 -32
- data/lib/pubnub/validators/get_members.rb +0 -32
- data/lib/pubnub/validators/get_space.rb +0 -32
- data/lib/pubnub/validators/get_space_memberships.rb +0 -32
- data/lib/pubnub/validators/get_spaces.rb +0 -16
- data/lib/pubnub/validators/get_user.rb +0 -32
- data/lib/pubnub/validators/get_users.rb +0 -16
- data/lib/pubnub/validators/manage_members.rb +0 -45
- data/lib/pubnub/validators/manage_memberships.rb +0 -45
- data/lib/pubnub/validators/push.rb +0 -43
- data/lib/pubnub/validators/update_space.rb +0 -45
- data/lib/pubnub/validators/update_user.rb +0 -45
- data/spec/examples/revoke_examples_spec.rb +0 -71950
- data/spec/examples/subscribe_examples_spec.rb +0 -45184
- data/spec/lib/events/space_spec.rb +0 -75
- data/spec/lib/events/user_spec.rb +0 -75
@@ -34,18 +34,20 @@ describe Pubnub::History do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
it "
|
37
|
+
it "__channel___demo___count__10___start__nil___end__nil___reverse__false___http_sync__true___callback__nil___encrypted__true___random_iv__false_" do
|
38
38
|
@pubnub = Pubnub.new(
|
39
39
|
publish_key: "pub-a-mock-key",
|
40
40
|
subscribe_key: "sub-a-mock-key",
|
41
41
|
uuid: "ruby-test-uuid-client-one",
|
42
42
|
auth_key: "ruby-test-auth-client-one",
|
43
43
|
cipher_key: "super-secret-cipher-key",
|
44
|
+
random_iv: false
|
44
45
|
)
|
45
46
|
VCR.use_cassette("examples/history/no_includes__encrypted", :record => :none) do
|
46
|
-
envelope = @pubnub.history(channel: :
|
47
|
+
envelope = @pubnub.history(channel: :rubytest1, count: 10, http_sync: true)
|
47
48
|
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
48
49
|
expect(envelope.error?).to eq false
|
50
|
+
expect(@pubnub.env[:random_iv]).to eq false
|
49
51
|
|
50
52
|
expect(envelope.status[:code]).to eq(200)
|
51
53
|
expect(envelope.status[:category]).to eq(:ack)
|
@@ -53,22 +55,24 @@ describe Pubnub::History do
|
|
53
55
|
|
54
56
|
expect(envelope.result[:code]).to eq(200)
|
55
57
|
expect(envelope.result[:operation]).to eq(:history)
|
56
|
-
expect(envelope.result[:data]).to eq({:messages => [100], :end =>
|
58
|
+
expect(envelope.result[:data]).to eq({:messages => [100], :end => 16148147101366576, :start => 16148147101366576})
|
57
59
|
end
|
58
60
|
end
|
59
61
|
|
60
|
-
it "
|
62
|
+
it "__channel___demo___count__10___start__nil___end__nil___reverse__false___http_sync__true___callback__nil___include_meta__true___encrypted__true___random_iv__false_" do
|
61
63
|
@pubnub = Pubnub.new(
|
62
64
|
publish_key: "pub-a-mock-key",
|
63
65
|
subscribe_key: "sub-a-mock-key",
|
64
66
|
uuid: "ruby-test-uuid-client-one",
|
65
67
|
auth_key: "ruby-test-auth-client-one",
|
66
68
|
cipher_key: "super-secret-cipher-key",
|
69
|
+
random_iv: false
|
67
70
|
)
|
68
71
|
VCR.use_cassette("examples/history/include_meta__encrypted", :record => :none) do
|
69
|
-
envelope = @pubnub.history(channel: :
|
72
|
+
envelope = @pubnub.history(channel: :rubytest2, count: 10, include_meta: true, http_sync: true)
|
70
73
|
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
71
74
|
expect(envelope.error?).to eq false
|
75
|
+
expect(@pubnub.env[:random_iv]).to eq false
|
72
76
|
|
73
77
|
expect(envelope.status[:code]).to eq(200)
|
74
78
|
expect(envelope.status[:category]).to eq(:ack)
|
@@ -76,22 +80,24 @@ describe Pubnub::History do
|
|
76
80
|
|
77
81
|
expect(envelope.result[:code]).to eq(200)
|
78
82
|
expect(envelope.result[:operation]).to eq(:history)
|
79
|
-
expect(envelope.result[:data]).to eq({:messages => [{"message" => 100, "meta" => "", "timetoken" =>
|
83
|
+
expect(envelope.result[:data]).to eq({:messages => [{"message" => 100, "meta" => "", "timetoken" => 16148149695171741}], :end => 16148149695171741, :start => 16148149695171741})
|
80
84
|
end
|
81
85
|
end
|
82
86
|
|
83
|
-
it "
|
87
|
+
it "__channel___demo___count__10___start__nil___end__nil___reverse__false___http_sync__true___callback__nil___include_token__true___encrypted__true___random_iv__false_" do
|
84
88
|
@pubnub = Pubnub.new(
|
85
89
|
publish_key: "pub-a-mock-key",
|
86
90
|
subscribe_key: "sub-a-mock-key",
|
87
91
|
uuid: "ruby-test-uuid-client-one",
|
88
92
|
auth_key: "ruby-test-auth-client-one",
|
89
93
|
cipher_key: "super-secret-cipher-key",
|
94
|
+
random_iv: false
|
90
95
|
)
|
91
96
|
VCR.use_cassette("examples/history/include_token__encrypted", :record => :none) do
|
92
|
-
envelope = @pubnub.history(channel: :
|
97
|
+
envelope = @pubnub.history(channel: :rubytest3, count: 10, include_token: true, http_sync: true)
|
93
98
|
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
94
99
|
expect(envelope.error?).to eq false
|
100
|
+
expect(@pubnub.env[:random_iv]).to eq false
|
95
101
|
|
96
102
|
expect(envelope.status[:code]).to eq(200)
|
97
103
|
expect(envelope.status[:category]).to eq(:ack)
|
@@ -99,7 +105,79 @@ describe Pubnub::History do
|
|
99
105
|
|
100
106
|
expect(envelope.result[:code]).to eq(200)
|
101
107
|
expect(envelope.result[:operation]).to eq(:history)
|
102
|
-
expect(envelope.result[:data]).to eq({:messages => [{"message" => 100, "timetoken" =>
|
108
|
+
expect(envelope.result[:data]).to eq({:messages => [{"message" => 100, "timetoken" => 16148151241848372}], :end => 16148151241848372, :start => 16148151241848372})
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
it "__channel___demo___count__10___start__nil___end__nil___reverse__false___http_sync__true___callback__nil___encrypted__true___random_iv__true_" do
|
113
|
+
@pubnub = Pubnub.new(
|
114
|
+
publish_key: "pub-a-mock-key",
|
115
|
+
subscribe_key: "sub-a-mock-key",
|
116
|
+
uuid: "ruby-test-uuid-client-one",
|
117
|
+
auth_key: "ruby-test-auth-client-one",
|
118
|
+
cipher_key: "super-secret-cipher-key"
|
119
|
+
)
|
120
|
+
VCR.use_cassette("examples/history/no_includes__encrypted_random_iv", :record => :none) do
|
121
|
+
envelope = @pubnub.history(channel: :rubytest4, count: 10, http_sync: true)
|
122
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
123
|
+
expect(envelope.error?).to eq false
|
124
|
+
expect(@pubnub.env[:random_iv]).to eq true
|
125
|
+
|
126
|
+
expect(envelope.status[:code]).to eq(200)
|
127
|
+
expect(envelope.status[:category]).to eq(:ack)
|
128
|
+
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"})
|
129
|
+
|
130
|
+
expect(envelope.result[:code]).to eq(200)
|
131
|
+
expect(envelope.result[:operation]).to eq(:history)
|
132
|
+
expect(envelope.result[:data]).to eq({:messages => [100], :end => 16148153795208310, :start => 16148153795208310})
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
it "__channel___demo___count__10___start__nil___end__nil___reverse__false___http_sync__true___callback__nil___include_meta__true___encrypted__true___random_iv__false_" do
|
137
|
+
@pubnub = Pubnub.new(
|
138
|
+
publish_key: "pub-a-mock-key",
|
139
|
+
subscribe_key: "sub-a-mock-key",
|
140
|
+
uuid: "ruby-test-uuid-client-one",
|
141
|
+
auth_key: "ruby-test-auth-client-one",
|
142
|
+
cipher_key: "super-secret-cipher-key"
|
143
|
+
)
|
144
|
+
VCR.use_cassette("examples/history/include_meta__encrypted_random_iv", :record => :none) do
|
145
|
+
envelope = @pubnub.history(channel: :rubytest5, count: 10, include_meta: true, http_sync: true)
|
146
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
147
|
+
expect(envelope.error?).to eq false
|
148
|
+
expect(@pubnub.env[:random_iv]).to eq true
|
149
|
+
|
150
|
+
expect(envelope.status[:code]).to eq(200)
|
151
|
+
expect(envelope.status[:category]).to eq(:ack)
|
152
|
+
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"})
|
153
|
+
|
154
|
+
expect(envelope.result[:code]).to eq(200)
|
155
|
+
expect(envelope.result[:operation]).to eq(:history)
|
156
|
+
expect(envelope.result[:data]).to eq({:messages => [{"message" => 100, "meta" => "", "timetoken" => 16148154562721969}], :end => 16148154562721969, :start => 16148154562721969})
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
it "__channel___demo___count__10___start__nil___end__nil___reverse__false___http_sync__true___callback__nil___include_token__true___encrypted__true___random_iv__true_" do
|
161
|
+
@pubnub = Pubnub.new(
|
162
|
+
publish_key: "pub-a-mock-key",
|
163
|
+
subscribe_key: "sub-a-mock-key",
|
164
|
+
uuid: "ruby-test-uuid-client-one",
|
165
|
+
auth_key: "ruby-test-auth-client-one",
|
166
|
+
cipher_key: "super-secret-cipher-key"
|
167
|
+
)
|
168
|
+
VCR.use_cassette("examples/history/include_token__encrypted_random_iv", :record => :none) do
|
169
|
+
envelope = @pubnub.history(channel: :rubytest6, count: 10, include_token: true, http_sync: true)
|
170
|
+
expect(envelope.is_a?(Pubnub::Envelope)).to eq true
|
171
|
+
expect(envelope.error?).to eq false
|
172
|
+
expect(@pubnub.env[:random_iv]).to eq true
|
173
|
+
|
174
|
+
expect(envelope.status[:code]).to eq(200)
|
175
|
+
expect(envelope.status[:category]).to eq(:ack)
|
176
|
+
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"})
|
177
|
+
|
178
|
+
expect(envelope.result[:code]).to eq(200)
|
179
|
+
expect(envelope.result[:operation]).to eq(:history)
|
180
|
+
expect(envelope.result[:data]).to eq({:messages => [{"message" => 100, "timetoken" => 16148155532212500}], :end => 16148155532212500, :start => 16148155532212500})
|
103
181
|
end
|
104
182
|
end
|
105
183
|
|
@@ -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
|