pubnub 4.0.27 → 4.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pubnub might be problematic. Click here for more details.

Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.pubnub.yml +8 -1
  3. data/.rubocop.yml +9 -3
  4. data/.travis.yml +6 -19
  5. data/CHANGELOG.md +86 -82
  6. data/Gemfile +7 -5
  7. data/Gemfile.lock +155 -157
  8. data/README.md +34 -34
  9. data/VERSION +1 -1
  10. data/gemfiles/celluloid_017.gemfile +4 -4
  11. data/gemfiles/celluloid_018.gemfile +4 -4
  12. data/gemfiles/celluloid_master.gemfile +4 -4
  13. data/gemfiles/concurrent-ruby-1.0.5.gem +0 -0
  14. data/gemfiles/concurrent-ruby-edge-0.3.1.gem +0 -0
  15. data/lib/pubnub.rb +3 -3
  16. data/lib/pubnub/client.rb +19 -16
  17. data/lib/pubnub/client/events.rb +5 -5
  18. data/lib/pubnub/client/getters_setters.rb +11 -12
  19. data/lib/pubnub/client/paged_history.rb +11 -9
  20. data/lib/pubnub/configuration.rb +1 -2
  21. data/lib/pubnub/constants.rb +47 -47
  22. data/lib/pubnub/crypto.rb +2 -2
  23. data/lib/pubnub/envelope.rb +7 -5
  24. data/lib/pubnub/error.rb +22 -15
  25. data/lib/pubnub/event.rb +24 -25
  26. data/lib/pubnub/event/formatter.rb +8 -5
  27. data/lib/pubnub/event/signature.rb +3 -3
  28. data/lib/pubnub/events/audit.rb +1 -1
  29. data/lib/pubnub/events/channel_registration.rb +10 -15
  30. data/lib/pubnub/events/delete_messages.rb +9 -9
  31. data/lib/pubnub/events/grant.rb +3 -3
  32. data/lib/pubnub/events/heartbeat.rb +4 -8
  33. data/lib/pubnub/events/here_now.rb +4 -8
  34. data/lib/pubnub/events/history.rb +10 -10
  35. data/lib/pubnub/events/leave.rb +2 -2
  36. data/lib/pubnub/events/presence.rb +1 -1
  37. data/lib/pubnub/events/publish.rb +3 -5
  38. data/lib/pubnub/events/revoke.rb +3 -3
  39. data/lib/pubnub/events/set_state.rb +3 -3
  40. data/lib/pubnub/events/state.rb +4 -6
  41. data/lib/pubnub/events/subscribe.rb +1 -1
  42. data/lib/pubnub/events/time.rb +2 -2
  43. data/lib/pubnub/events/where_now.rb +6 -6
  44. data/lib/pubnub/format.rb +73 -0
  45. data/lib/pubnub/formatter.rb +23 -21
  46. data/lib/pubnub/heart.rb +4 -4
  47. data/lib/pubnub/origin_manager.rb +3 -5
  48. data/lib/pubnub/pam.rb +5 -5
  49. data/lib/pubnub/schemas/envelope_schema.rb +1 -1
  50. data/lib/pubnub/subscribe_callback.rb +3 -3
  51. data/lib/pubnub/subscribe_event.rb +6 -10
  52. data/lib/pubnub/subscribe_event/formatter.rb +82 -80
  53. data/lib/pubnub/subscribe_event/heartbeat.rb +1 -1
  54. data/lib/pubnub/subscriber.rb +31 -32
  55. data/lib/pubnub/telemetry.rb +26 -27
  56. data/lib/pubnub/validators/audit.rb +3 -2
  57. data/lib/pubnub/validators/channel_registration.rb +6 -4
  58. data/lib/pubnub/validators/client.rb +1 -0
  59. data/lib/pubnub/validators/common_validator.rb +37 -31
  60. data/lib/pubnub/validators/delete.rb +5 -4
  61. data/lib/pubnub/validators/grant.rb +3 -2
  62. data/lib/pubnub/validators/history.rb +3 -2
  63. data/lib/pubnub/validators/leave.rb +3 -2
  64. data/lib/pubnub/validators/presence.rb +3 -2
  65. data/lib/pubnub/validators/publish.rb +15 -10
  66. data/lib/pubnub/validators/set_state.rb +0 -2
  67. data/lib/pubnub/validators/state.rb +3 -2
  68. data/lib/pubnub/version.rb +1 -1
  69. data/pubnub.gemspec +19 -18
  70. data/spec/examples/audit_examples_spec.rb +1268 -1418
  71. data/spec/examples/channel_registration_examples_spec.rb +655 -757
  72. data/spec/examples/delete_messages_examples_spec.rb +19 -21
  73. data/spec/examples/grant_examples_spec.rb +34028 -37920
  74. data/spec/examples/heartbeat_examples_spec.rb +583 -731
  75. data/spec/examples/here_now_examples_spec.rb +493 -569
  76. data/spec/examples/history_examples_spec.rb +979 -1127
  77. data/spec/examples/leave_examples_spec.rb +439 -551
  78. data/spec/examples/presence_examples_spec.rb +686 -830
  79. data/spec/examples/publish_examples_spec.rb +27223 -31547
  80. data/spec/examples/publish_with_ttl_spec.rb +11 -14
  81. data/spec/examples/revoke_examples_spec.rb +68048 -75828
  82. data/spec/examples/set_state_examples_spec.rb +295 -371
  83. data/spec/examples/state_examples_spec.rb +169 -197
  84. data/spec/examples/status_request_message_count_exceeded_spec.rb +16 -19
  85. data/spec/examples/subscribe_examples_spec.rb +43843 -52035
  86. data/spec/examples/time_examples_spec.rb +82 -98
  87. data/spec/examples/where_now_examples_spec.rb +88 -104
  88. data/spec/lib/client_spec.rb +99 -117
  89. data/spec/lib/connection_callback_spec.rb +27 -33
  90. data/spec/lib/custom_retries_examples_spec.rb +8 -11
  91. data/spec/lib/event_spec.rb +35 -42
  92. data/spec/lib/events/audit_spec.rb +19 -25
  93. data/spec/lib/events/channel_registration_spec.rb +17 -23
  94. data/spec/lib/events/delete_messages_spec.rb +14 -20
  95. data/spec/lib/events/grant_spec.rb +15 -21
  96. data/spec/lib/events/heartbeat_spec.rb +21 -27
  97. data/spec/lib/events/here_now_spec.rb +14 -20
  98. data/spec/lib/events/history_spec.rb +14 -20
  99. data/spec/lib/events/leave_spec.rb +14 -20
  100. data/spec/lib/events/presence_delta_spec.rb +15 -16
  101. data/spec/lib/events/presence_spec.rb +36 -45
  102. data/spec/lib/events/publish_spec.rb +33 -40
  103. data/spec/lib/events/revoke_spec.rb +16 -22
  104. data/spec/lib/events/state_spec.rb +16 -22
  105. data/spec/lib/events/subscribe_spec.rb +75 -85
  106. data/spec/lib/events/time_spec.rb +12 -18
  107. data/spec/lib/events/timeout_handling_spec.rb +8 -14
  108. data/spec/lib/events/where_now_spec.rb +14 -20
  109. data/spec/lib/keep_alive_spec.rb +4 -8
  110. data/spec/lib/multiple_ciphers_spec.rb +56 -60
  111. data/spec/lib/pubnub_spec.rb +10 -13
  112. data/spec/lib/signatures_spec.rb +118 -120
  113. data/spec/lib/ssl_error_spec.rb +14 -18
  114. data/spec/lib/super_admin_spec.rb +58 -66
  115. data/spec/lib/uuid_spec.rb +3 -4
  116. data/spec/spec_expectations.rb +3 -3
  117. data/spec/spec_helper.rb +29 -46
  118. metadata +52 -22
  119. data/lib/pubnub/message.rb +0 -43
@@ -14,13 +14,14 @@ module Pubnub
14
14
  private
15
15
 
16
16
  def validate_auth_key!
17
- fail(
17
+ return unless @channel.size > 1 && @auth.to_s.count(',') > 0
18
+ raise(
18
19
  ArgumentError.new(
19
20
  object: self,
20
21
  message: 'Invalid :auth_key. You can\'t run audit for multiple channels and keys at once'
21
22
  ),
22
23
  'Invalid :auth_key. You can\'t run audit for multiple channels and keys at once'
23
- ) if @channel.size > 1 && @auth.to_s.count(',') > 0
24
+ )
24
25
  end
25
26
  end
26
27
  end
@@ -19,20 +19,22 @@ module Pubnub
19
19
  end
20
20
 
21
21
  def validate_action_presence!
22
- fail(
22
+ return unless @action.nil?
23
+ raise(
23
24
  ArgumentError.new,
24
25
  ':action is required for channel registration event.'
25
- ) if @action.nil?
26
+ )
26
27
  end
27
28
 
28
29
  def validate_action_correctness!
29
- fail(
30
+ return if %i[add list_groups get remove list_namespaces].include?(@action.to_sym)
31
+ raise(
30
32
  ArgumentError.new(
31
33
  object: self,
32
34
  message: 'Invalid :action key. Valid action keys are: :add, :list_groups, :get, :remove key'
33
35
  ),
34
36
  'Invalid :action key. Valid action keys are: :add, :list_groups, :get, :remove key'
35
- ) unless [:add, :list_groups, :get, :remove, :list_namespaces].include?(@action.to_sym)
37
+ )
36
38
  end
37
39
  end
38
40
  end
@@ -6,6 +6,7 @@ module Pubnub
6
6
  module Client
7
7
  class << self
8
8
  include CommonValidator
9
+
9
10
  def validate!(parameters)
10
11
  validate_origin parameters[:origin], true
11
12
  validate_subscribe_key parameters[:subscribe_key], true
@@ -6,45 +6,51 @@ module Pubnub
6
6
  module CommonValidator
7
7
  # Validates given origin
8
8
  def validate_origin(origin, required = false)
9
- fail(
10
- InitializationError.new,
11
- 'Missing required :origins_pool parameter.'
12
- ) if !origin && required
13
-
14
- fail(
15
- InitializationError.new,
16
- 'origins_pool parameter is not valid. \
17
- Should be type of String.'
18
- ) unless origin.is_a?(String) || origin.blank?
9
+ if !origin && required
10
+ raise(
11
+ InitializationError.new,
12
+ 'Missing required :origins_pool parameter.'
13
+ )
14
+ elsif !(origin.is_a?(String) || origin.blank?)
15
+ raise(
16
+ InitializationError.new,
17
+ 'origins_pool parameter is not valid. \
18
+ Should be type of String.'
19
+ )
20
+ end
19
21
  end
20
22
 
21
23
  # Validates given subscribe key
22
24
  def validate_subscribe_key(subscribe_key, required = false)
23
- fail(
24
- InitializationError.new,
25
- 'Missing required :subscribe_key parameter.'
26
- ) if !subscribe_key && required
27
-
28
- fail(
29
- InitializationError.new,
30
- 'Subscribe key parameter is not valid. \
31
- Should be type of String or Symbol.'
32
- ) unless [String, Symbol].include?(subscribe_key.class)
25
+ if !subscribe_key && required
26
+ raise(
27
+ InitializationError.new,
28
+ 'Missing required :subscribe_key parameter.'
29
+ )
30
+ elsif ![String, Symbol].include?(subscribe_key.class)
31
+ raise(
32
+ InitializationError.new,
33
+ 'Subscribe key parameter is not valid. \
34
+ Should be type of String or Symbol.'
35
+ )
36
+ end
33
37
  end
34
38
 
35
39
  # Validates given publish key
36
40
  def validate_publish_key(publish_key, required = false)
37
- fail(
38
- InitializationError.new,
39
- 'Missing required :subscribe_key parameter.'
40
- ) if !publish_key && required
41
-
42
- fail(
43
- InitializationError.new,
44
- 'Publish key parameter is not valid. \
45
- Should be type of String or Symbol.'
46
- ) unless [String, Symbol].include?(publish_key.class) ||
47
- publish_key.blank?
41
+ if !publish_key && required
42
+ raise(
43
+ InitializationError.new,
44
+ 'Missing required :subscribe_key parameter.'
45
+ )
46
+ elsif !([String, Symbol].include?(publish_key.class) ||
47
+ publish_key.blank?)
48
+ raise(
49
+ InitializationError.new,
50
+ 'Publish key parameter is not valid. \
51
+ Should be type of String or Symbol.'
52
+ )
53
+ end
48
54
  end
49
55
  end
50
56
  end
@@ -14,10 +14,11 @@ module Pubnub
14
14
  private
15
15
 
16
16
  def validate_channel!
17
- fail(
18
- ArgumentError.new,
19
- 'You have to call #delete on single channel'
20
- ) if @channel.blank? || @channel.index(',')
17
+ return unless @channel.blank? || @channel.index(',')
18
+ raise(
19
+ ArgumentError.new,
20
+ 'You have to call #delete on single channel'
21
+ )
21
22
  end
22
23
  end
23
24
  end
@@ -14,10 +14,11 @@ module Pubnub
14
14
  private
15
15
 
16
16
  def validate_ttl!
17
- fail(
17
+ return unless !@ttl.nil? && !@ttl.is_a?(Integer)
18
+ raise(
18
19
  ArgumentError.new,
19
20
  ':ttl has to be kind of Integer'
20
- ) if !@ttl.nil? && !@ttl.is_a?(Integer)
21
+ )
21
22
  end
22
23
  end
23
24
  end
@@ -14,13 +14,14 @@ module Pubnub
14
14
  private
15
15
 
16
16
  def validate_channel!
17
- fail(
17
+ return unless @channel.size > 1
18
+ raise(
18
19
  ArgumentError.new(
19
20
  object: self,
20
21
  message: 'Invalid :channel. You can run History for a single channel at once.'
21
22
  ),
22
23
  'Invalid :channel. You can run History for a single channel at once.'
23
- ) if @channel.size > 1
24
+ )
24
25
  end
25
26
  end
26
27
  end
@@ -12,13 +12,14 @@ module Pubnub
12
12
  end
13
13
 
14
14
  def validate_channel_and_group!
15
- fail(
15
+ return unless @channel.empty? && @group.empty? && @wildcard_channel.empty?
16
+ raise(
16
17
  ArgumentError.new(
17
18
  object: self,
18
19
  message: 'You have to specify :channel or :group while using Leave event.'
19
20
  ),
20
21
  'You have to specify :channel or :group while using Leave event.'
21
- ) if @channel.size == 0 && @group.size == 0 && @wildcard_channel.size == 0
22
+ )
22
23
  end
23
24
  end
24
25
  end
@@ -14,13 +14,14 @@ module Pubnub
14
14
  private
15
15
 
16
16
  def validate_channels!
17
- fail(
17
+ return unless @channel.empty? && @group.empty? && @wildcard_channel.empty?
18
+ raise(
18
19
  ArgumentError.new(
19
20
  object: self,
20
21
  message: 'You have to specify :channel or :group while using Presence event.'
21
22
  ),
22
23
  'You have to specify :channel or :group while using Presence event.'
23
- ) if @channel.size == 0 && @group.size == 0 && @wildcard_channel.size == 0
24
+ )
24
25
  end
25
26
  end
26
27
  end
@@ -18,38 +18,43 @@ module Pubnub
18
18
  private
19
19
 
20
20
  def validate_publish_key!
21
- fail(
21
+ return unless @publish_key.nil?
22
+ raise(
22
23
  ArgumentError.new,
23
24
  ':publish_key is required for publish event.'
24
- ) if @publish_key.nil?
25
+ )
25
26
  end
26
27
 
27
28
  def validate_store!
28
- fail(
29
+ return if @store.nil? || [true, false].include?(@store)
30
+ raise(
29
31
  ArgumentError.new,
30
32
  ':store parameter invalid (should be true or false).'
31
- ) unless @store.nil? || [true, false].include?(@store)
33
+ )
32
34
  end
33
35
 
34
36
  def validate_channel!
35
- fail(
37
+ return unless @channel.nil? || @channel.empty?
38
+ raise(
36
39
  ArgumentError.new,
37
40
  ':channel is required for publish event.'
38
- ) if @channel.nil? || @channel.empty?
41
+ )
39
42
  end
40
43
 
41
44
  def validate_message!
42
- fail(
45
+ return unless @message.nil?
46
+ raise(
43
47
  ArgumentError.new,
44
48
  ':message is required for publish event.'
45
- ) if @message.nil?
49
+ )
46
50
  end
47
51
 
48
52
  def validate_meta!
49
- fail(
53
+ return unless !@meta.nil? && @meta.class != Hash
54
+ raise(
50
55
  ArgumentError.new,
51
56
  ':meta parameter must me hash.'
52
- ) if !@meta.nil? && @meta.class != Hash
57
+ )
53
58
  end
54
59
  end
55
60
  end
@@ -9,8 +9,6 @@ module Pubnub
9
9
  def validate!
10
10
  return if @skip_validate
11
11
  end
12
-
13
- private
14
12
  end
15
13
  end
16
14
  end
@@ -14,13 +14,14 @@ module Pubnub
14
14
  private
15
15
 
16
16
  def validate_channel_and_uuid!
17
- fail(
17
+ return unless @channel.empty? && @uuid_looking_for.nil?
18
+ raise(
18
19
  ArgumentError.new(
19
20
  object: self,
20
21
  message: 'You have to specify :channel or :uuid for State event.'
21
22
  ),
22
23
  'You have to specify :channel or :uuid for State event.'
23
- ) if @channel.size == 0 && @uuid_looking_for.nil?
24
+ )
24
25
  end
25
26
  end
26
27
  end
@@ -1,4 +1,4 @@
1
1
  # Toplevel Pubnub module.
2
2
  module Pubnub
3
- VERSION = '4.0.27'
3
+ VERSION = '4.0.28'.freeze
4
4
  end
@@ -1,26 +1,27 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'pubnub/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
- spec.name = 'pubnub'
8
- spec.version = Pubnub::VERSION
9
- spec.authors = ['PubNub']
10
- spec.email = ['support@pubnub.com']
11
- spec.summary = 'PubNub Official Ruby gem.'
12
- spec.description = 'Ruby anywhere in the world in 250ms with PubNub!'
13
- spec.homepage = 'http://github.com/pubnub/ruby'
14
- spec.license = 'MIT'
6
+ spec.name = 'pubnub'
7
+ spec.version = Pubnub::VERSION
8
+ spec.authors = ['PubNub']
9
+ spec.email = ['support@pubnub.com']
10
+ spec.summary = 'PubNub Official Ruby gem.'
11
+ spec.description = 'Ruby anywhere in the world in 250ms with PubNub!'
12
+ spec.homepage = 'http://github.com/pubnub/ruby'
13
+ spec.license = 'MIT'
15
14
 
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin\/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)\/})
19
- spec.require_paths = ['lib']
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin\/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)\/})
18
+ spec.require_paths = ['lib']
20
19
 
21
- spec.add_dependency 'celluloid', '~> 0.17'
22
- spec.add_dependency 'json', '>= 1.8', '< 3'
23
- spec.add_dependency 'httpclient', '~> 2.8', '>= 2.8.3'
24
- spec.add_dependency 'dry-validation', '~> 0.10'
20
+ spec.add_dependency 'concurrent-ruby', '~> 1.0.5'
21
+ spec.add_dependency 'concurrent-ruby-edge', '~> 0.3.1'
22
+ spec.add_dependency 'dry-validation', '~> 0.10'
23
+ spec.add_dependency 'httpclient', '~> 2.8', '>= 2.8.3'
24
+ spec.add_dependency 'json', '>= 1.8', '< 3'
25
+ spec.add_dependency 'timers', '>= 4.1.1'
25
26
  spec.add_development_dependency 'bundler', '~> 1.7'
26
27
  end
@@ -1,1503 +1,1353 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe Pubnub::Audit do
4
4
  around :each do |example|
5
- Celluloid.boot
6
-
7
5
  @fired = false
8
6
 
9
- @callback = ->(_envelope) do
7
+ @callback = -> (_envelope) do
10
8
  @fired = true
11
9
  end
12
10
 
13
11
  @pubnub = Pubnub.new(
14
- publish_key: 'pub-c-b42cec2f-f468-4784-8833-dd2b074538c4',
15
- subscribe_key: 'sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f',
16
- secret_key: 'sec-c-OWIyYmVlYWYtYWMxMS00OTcxLTlhZDAtZDBlYTM4ODE1MWUy',
17
- uuid: 'ruby-test-uuid-client-one',
18
- auth_key: 'ruby-test-auth-client-one'
12
+ publish_key: "pub-c-b42cec2f-f468-4784-8833-dd2b074538c4",
13
+ subscribe_key: "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f",
14
+ secret_key: "sec-c-OWIyYmVlYWYtYWMxMS00OTcxLTlhZDAtZDBlYTM4ODE1MWUy",
15
+ uuid: "ruby-test-uuid-client-one",
16
+ auth_key: "ruby-test-auth-client-one",
19
17
  )
20
18
 
21
- example.run
22
-
23
- Celluloid.shutdown
19
+ example.run_with_retry retry: 10
24
20
  end
25
21
 
26
- it '__auth_key___key____channel___demo___channel_group__nil___http_sync__true___callback__nil_' do
27
- VCR.use_cassette('examples/audit/11', record: :none) do
28
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186843'
29
- Pubnub::Audit.any_instance.stub(:signature).and_return 'QYT-McoRqpPCoXnKTZ3cGs5Ad0IUXQgiMfyO2wrto-o='
30
- envelope = @pubnub.audit(auth_key: 'key', channel: :demo, http_sync: true)
31
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
32
- expect(envelope.error?).to eq false
33
-
34
- expect(envelope.status[:code]).to eq(200)
35
- expect(envelope.status[:category]).to eq(:ack)
36
- 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"})
37
-
38
- expect(envelope.result[:code]).to eq(200)
39
- expect(envelope.result[:operation]).to eq(:audit)
40
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
41
-
42
- end
43
- end
44
-
45
-
46
- it '__auth_key___key____channel___demo___channel_group__nil___http_sync__true___callback___block_' do
47
- VCR.use_cassette('examples/audit/9', record: :none) do
48
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186844'
49
- Pubnub::Audit.any_instance.stub(:signature).and_return 'QXwMqXUiKbL8-Lbho-KVx2BjQAgkrrcK3W5D3vN-B7E='
50
- envelope = @pubnub.audit(auth_key: 'key', channel: :demo, http_sync: true, &@callback)
51
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
52
- expect(envelope.error?).to eq false
53
-
54
- expect(envelope.status[:code]).to eq(200)
55
- expect(envelope.status[:category]).to eq(:ack)
56
- 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"})
57
-
58
- expect(envelope.result[:code]).to eq(200)
59
- expect(envelope.result[:operation]).to eq(:audit)
60
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
61
-
62
- end
63
- end
64
-
65
-
66
- it '__auth_key___key____channel___demo___channel_group__nil___http_sync__true___callback___lambda_' do
67
- VCR.use_cassette('examples/audit/10', record: :none) do
68
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186844'
69
- Pubnub::Audit.any_instance.stub(:signature).and_return 'QXwMqXUiKbL8-Lbho-KVx2BjQAgkrrcK3W5D3vN-B7E='
70
- envelope = @pubnub.audit(auth_key: 'key', channel: :demo, http_sync: true, callback: @callback)
71
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
72
- expect(envelope.error?).to eq false
73
-
74
- expect(envelope.status[:code]).to eq(200)
75
- expect(envelope.status[:category]).to eq(:ack)
76
- 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"})
77
-
78
- expect(envelope.result[:code]).to eq(200)
79
- expect(envelope.result[:operation]).to eq(:audit)
80
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
81
-
82
- end
83
- end
84
-
85
-
86
- it '__auth_key___key____channel___demo___channel_group__nil___http_sync__false___callback__nil_' do
87
- VCR.use_cassette('examples/audit/8', record: :none) do
88
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187175'
89
- Pubnub::Audit.any_instance.stub(:signature).and_return 'fXZ_XH3NJl8fGfcrKUMoRseS_zjBncur_uAA9oRoxs4='
90
- envelope = @pubnub.audit(auth_key: 'key', channel: :demo, http_sync: false)
91
- envelope = envelope.value
92
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
93
- expect(envelope.error?).to eq false
94
-
95
- expect(envelope.status[:code]).to eq(200)
96
- expect(envelope.status[:category]).to eq(:ack)
97
- 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"})
98
-
99
- expect(envelope.result[:code]).to eq(200)
100
- expect(envelope.result[:operation]).to eq(:audit)
101
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
102
-
103
- end
104
- end
105
-
106
-
107
- it '__auth_key___key____channel___demo___channel_group__nil___http_sync__false___callback___block_' do
108
- VCR.use_cassette('examples/audit/6', record: :none) do
109
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187023'
110
- Pubnub::Audit.any_instance.stub(:signature).and_return 'LZ3T5rp8BCnQRVBA6fsmU6l_UDgjLjVHyXp3tlou1zY='
111
- envelope = @pubnub.audit(auth_key: 'key', channel: :demo, http_sync: false, &@callback)
112
- envelope = envelope.value
113
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
114
- expect(envelope.error?).to eq false
115
-
116
- expect(envelope.status[:code]).to eq(200)
117
- expect(envelope.status[:category]).to eq(:ack)
118
- 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"})
119
-
120
- expect(envelope.result[:code]).to eq(200)
121
- expect(envelope.result[:operation]).to eq(:audit)
122
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
123
-
124
- end
125
- end
126
-
127
-
128
- it '__auth_key___key____channel___demo___channel_group__nil___http_sync__false___callback___lambda_' do
129
- VCR.use_cassette('examples/audit/7', record: :none) do
130
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186846'
131
- Pubnub::Audit.any_instance.stub(:signature).and_return 'tc9XOqQGC3Qp123bP_MN45y9qrEIv2cdhP0OsWwo1bc='
132
- envelope = @pubnub.audit(auth_key: 'key', channel: :demo, http_sync: false, callback: @callback)
133
- envelope = envelope.value
134
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
135
- expect(envelope.error?).to eq false
136
-
137
- expect(envelope.status[:code]).to eq(200)
138
- expect(envelope.status[:category]).to eq(:ack)
139
- 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"})
140
-
141
- expect(envelope.result[:code]).to eq(200)
142
- expect(envelope.result[:operation]).to eq(:audit)
143
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
144
-
145
- end
146
- end
147
-
148
-
149
- it '__auth_key___key____channel___demo____channel_group__nil___http_sync__true___callback__nil_' do
150
- VCR.use_cassette('examples/audit/5', record: :none) do
151
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186847'
152
- Pubnub::Audit.any_instance.stub(:signature).and_return 'VQtsxNpNl8fCdTBt2VtZvblP5M7_xKQfV2cH1QJ9y0U='
153
- envelope = @pubnub.audit(auth_key: 'key', channel: 'demo', http_sync: true)
154
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
155
- expect(envelope.error?).to eq false
156
-
157
- expect(envelope.status[:code]).to eq(200)
158
- expect(envelope.status[:category]).to eq(:ack)
159
- 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"})
160
-
161
- expect(envelope.result[:code]).to eq(200)
162
- expect(envelope.result[:operation]).to eq(:audit)
163
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
164
-
165
- end
166
- end
167
-
168
-
169
- it '__auth_key___key____channel___demo____channel_group__nil___http_sync__true___callback___block_' do
170
- VCR.use_cassette('examples/audit/3', record: :none) do
171
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186848'
172
- Pubnub::Audit.any_instance.stub(:signature).and_return 'NXoP5si5ESsJjDhJck3EpkhfEeB49Km0R9w-XSutrto='
173
- envelope = @pubnub.audit(auth_key: 'key', channel: 'demo', http_sync: true, &@callback)
174
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
175
- expect(envelope.error?).to eq false
176
-
177
- expect(envelope.status[:code]).to eq(200)
178
- expect(envelope.status[:category]).to eq(:ack)
179
- 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"})
180
-
181
- expect(envelope.result[:code]).to eq(200)
182
- expect(envelope.result[:operation]).to eq(:audit)
183
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
184
-
185
- end
186
- end
187
-
188
-
189
- it '__auth_key___key____channel___demo____channel_group__nil___http_sync__true___callback___lambda_' do
190
- VCR.use_cassette('examples/audit/4', record: :none) do
191
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186848'
192
- Pubnub::Audit.any_instance.stub(:signature).and_return 'NXoP5si5ESsJjDhJck3EpkhfEeB49Km0R9w-XSutrto='
193
- envelope = @pubnub.audit(auth_key: 'key', channel: 'demo', http_sync: true, callback: @callback)
194
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
195
- expect(envelope.error?).to eq false
196
-
197
- expect(envelope.status[:code]).to eq(200)
198
- expect(envelope.status[:category]).to eq(:ack)
199
- 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"})
200
-
201
- expect(envelope.result[:code]).to eq(200)
202
- expect(envelope.result[:operation]).to eq(:audit)
203
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
204
-
205
- end
206
- end
207
-
208
-
209
- it '__auth_key___key____channel___demo____channel_group__nil___http_sync__false___callback__nil_' do
210
- VCR.use_cassette('examples/audit/2', record: :none) do
211
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187024'
212
- Pubnub::Audit.any_instance.stub(:signature).and_return '29x7wwIMVzIsnIo-pb6Yj0cxRMM1V_IkjePBFvQ169w='
213
- envelope = @pubnub.audit(auth_key: 'key', channel: 'demo', http_sync: false)
214
- envelope = envelope.value
215
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
216
- expect(envelope.error?).to eq false
217
-
218
- expect(envelope.status[:code]).to eq(200)
219
- expect(envelope.status[:category]).to eq(:ack)
220
- 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"})
221
-
222
- expect(envelope.result[:code]).to eq(200)
223
- expect(envelope.result[:operation]).to eq(:audit)
224
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
225
-
226
- end
227
- end
228
-
229
-
230
- it '__auth_key___key____channel___demo____channel_group__nil___http_sync__false___callback___block_' do
231
- VCR.use_cassette('examples/audit/0', record: :none) do
232
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186849'
233
- Pubnub::Audit.any_instance.stub(:signature).and_return 'HUsH3eyTPCiYR_5gQ2YefizV6SswirTY5eaGHhsXbGw='
234
- envelope = @pubnub.audit(auth_key: 'key', channel: 'demo', http_sync: false, &@callback)
235
- envelope = envelope.value
236
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
237
- expect(envelope.error?).to eq false
238
-
239
- expect(envelope.status[:code]).to eq(200)
240
- expect(envelope.status[:category]).to eq(:ack)
241
- 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"})
242
-
243
- expect(envelope.result[:code]).to eq(200)
244
- expect(envelope.result[:operation]).to eq(:audit)
245
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
246
-
247
- end
248
- end
249
-
250
-
251
- it '__auth_key___key____channel___demo____channel_group__nil___http_sync__false___callback___lambda_' do
252
- VCR.use_cassette('examples/audit/1', record: :none) do
253
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187176'
254
- Pubnub::Audit.any_instance.stub(:signature).and_return 'zxDcoxKlyAvaeNvZ-W8i5DfEyQd2n_F-xrZtRbBAy4I='
255
- envelope = @pubnub.audit(auth_key: 'key', channel: 'demo', http_sync: false, callback: @callback)
256
- envelope = envelope.value
257
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
258
- expect(envelope.error?).to eq false
259
-
260
- expect(envelope.status[:code]).to eq(200)
261
- expect(envelope.status[:category]).to eq(:ack)
262
- 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"})
263
-
264
- expect(envelope.result[:code]).to eq(200)
265
- expect(envelope.result[:operation]).to eq(:audit)
266
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
22
+ it "__auth_key___key____channel___demo___channel_group__nil___http_sync__true___callback__nil_" do
23
+ VCR.use_cassette("examples/audit/11", record: :none) do
24
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186843"
25
+ Pubnub::Audit.any_instance.stub(:signature).and_return "QYT-McoRqpPCoXnKTZ3cGs5Ad0IUXQgiMfyO2wrto-o="
26
+ envelope = @pubnub.audit(auth_key: "key", channel: :demo, http_sync: true)
27
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
28
+ expect(envelope.error?).to eq false
29
+
30
+ expect(envelope.status[:code]).to eq(200)
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(:audit)
36
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
37
+ end
38
+ end
267
39
 
268
- end
269
- end
40
+ it "__auth_key___key____channel___demo___channel_group__nil___http_sync__true___callback___block_" do
41
+ VCR.use_cassette("examples/audit/9", record: :none) do
42
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186844"
43
+ Pubnub::Audit.any_instance.stub(:signature).and_return "QXwMqXUiKbL8-Lbho-KVx2BjQAgkrrcK3W5D3vN-B7E="
44
+ envelope = @pubnub.audit(auth_key: "key", channel: :demo, http_sync: true, &@callback)
45
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
46
+ expect(envelope.error?).to eq false
47
+
48
+ expect(envelope.status[:code]).to eq(200)
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(:audit)
54
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
55
+ end
56
+ end
270
57
 
58
+ it "__auth_key___key____channel___demo___channel_group__nil___http_sync__true___callback___lambda_" do
59
+ VCR.use_cassette("examples/audit/10", record: :none) do
60
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186844"
61
+ Pubnub::Audit.any_instance.stub(:signature).and_return "QXwMqXUiKbL8-Lbho-KVx2BjQAgkrrcK3W5D3vN-B7E="
62
+ envelope = @pubnub.audit(auth_key: "key", channel: :demo, http_sync: true, callback: @callback)
63
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
64
+ expect(envelope.error?).to eq false
65
+
66
+ expect(envelope.status[:code]).to eq(200)
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(:audit)
72
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
73
+ end
74
+ end
271
75
 
272
- it '__auth_key___key____channel__nil___channel_group___demo___http_sync__true___callback__nil_' do
273
- VCR.use_cassette('examples/audit/23', record: :none) do
274
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186850'
275
- Pubnub::Audit.any_instance.stub(:signature).and_return 'e7K35-o7JSo_hb9BQ-mngvBeLSehMkK9WRmyXDgNnYs='
276
- envelope = @pubnub.audit(auth_key: 'key', channel_group: :demo, http_sync: true)
277
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
278
- expect(envelope.error?).to eq false
76
+ it "__auth_key___key____channel___demo___channel_group__nil___http_sync__false___callback__nil_" do
77
+ VCR.use_cassette("examples/audit/8", record: :none) do
78
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187175"
79
+ Pubnub::Audit.any_instance.stub(:signature).and_return "fXZ_XH3NJl8fGfcrKUMoRseS_zjBncur_uAA9oRoxs4="
80
+ envelope = @pubnub.audit(auth_key: "key", channel: :demo, http_sync: false)
81
+ envelope = envelope.value
82
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
83
+ expect(envelope.error?).to eq false
84
+
85
+ expect(envelope.status[:code]).to eq(200)
86
+ expect(envelope.status[:category]).to eq(:ack)
87
+ 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"})
88
+
89
+ expect(envelope.result[:code]).to eq(200)
90
+ expect(envelope.result[:operation]).to eq(:audit)
91
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
92
+ end
93
+ end
279
94
 
280
- expect(envelope.status[:code]).to eq(200)
281
- expect(envelope.status[:category]).to eq(:ack)
282
- 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"})
95
+ it "__auth_key___key____channel___demo___channel_group__nil___http_sync__false___callback___block_" do
96
+ VCR.use_cassette("examples/audit/6", record: :none) do
97
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187023"
98
+ Pubnub::Audit.any_instance.stub(:signature).and_return "LZ3T5rp8BCnQRVBA6fsmU6l_UDgjLjVHyXp3tlou1zY="
99
+ envelope = @pubnub.audit(auth_key: "key", channel: :demo, http_sync: false, &@callback)
100
+ envelope = envelope.value
101
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
102
+ expect(envelope.error?).to eq false
103
+
104
+ expect(envelope.status[:code]).to eq(200)
105
+ expect(envelope.status[:category]).to eq(:ack)
106
+ 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"})
107
+
108
+ expect(envelope.result[:code]).to eq(200)
109
+ expect(envelope.result[:operation]).to eq(:audit)
110
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
111
+ end
112
+ end
283
113
 
284
- expect(envelope.result[:code]).to eq(200)
285
- expect(envelope.result[:operation]).to eq(:audit)
286
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
114
+ it "__auth_key___key____channel___demo___channel_group__nil___http_sync__false___callback___lambda_" do
115
+ VCR.use_cassette("examples/audit/7", record: :none) do
116
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186846"
117
+ Pubnub::Audit.any_instance.stub(:signature).and_return "tc9XOqQGC3Qp123bP_MN45y9qrEIv2cdhP0OsWwo1bc="
118
+ envelope = @pubnub.audit(auth_key: "key", channel: :demo, http_sync: false, callback: @callback)
119
+ envelope = envelope.value
120
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
121
+ expect(envelope.error?).to eq false
122
+
123
+ expect(envelope.status[:code]).to eq(200)
124
+ expect(envelope.status[:category]).to eq(:ack)
125
+ 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"})
126
+
127
+ expect(envelope.result[:code]).to eq(200)
128
+ expect(envelope.result[:operation]).to eq(:audit)
129
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
130
+ end
131
+ end
287
132
 
288
- end
289
- end
133
+ it "__auth_key___key____channel___demo____channel_group__nil___http_sync__true___callback__nil_" do
134
+ VCR.use_cassette("examples/audit/5", record: :none) do
135
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186847"
136
+ Pubnub::Audit.any_instance.stub(:signature).and_return "VQtsxNpNl8fCdTBt2VtZvblP5M7_xKQfV2cH1QJ9y0U="
137
+ envelope = @pubnub.audit(auth_key: "key", channel: "demo", http_sync: true)
138
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
139
+ expect(envelope.error?).to eq false
140
+
141
+ expect(envelope.status[:code]).to eq(200)
142
+ expect(envelope.status[:category]).to eq(:ack)
143
+ 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"})
144
+
145
+ expect(envelope.result[:code]).to eq(200)
146
+ expect(envelope.result[:operation]).to eq(:audit)
147
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
148
+ end
149
+ end
290
150
 
151
+ it "__auth_key___key____channel___demo____channel_group__nil___http_sync__true___callback___block_" do
152
+ VCR.use_cassette("examples/audit/3", record: :none) do
153
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186848"
154
+ Pubnub::Audit.any_instance.stub(:signature).and_return "NXoP5si5ESsJjDhJck3EpkhfEeB49Km0R9w-XSutrto="
155
+ envelope = @pubnub.audit(auth_key: "key", channel: "demo", http_sync: true, &@callback)
156
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
157
+ expect(envelope.error?).to eq false
158
+
159
+ expect(envelope.status[:code]).to eq(200)
160
+ expect(envelope.status[:category]).to eq(:ack)
161
+ 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"})
162
+
163
+ expect(envelope.result[:code]).to eq(200)
164
+ expect(envelope.result[:operation]).to eq(:audit)
165
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
166
+ end
167
+ end
291
168
 
292
- it '__auth_key___key____channel__nil___channel_group___demo___http_sync__true___callback___block_' do
293
- VCR.use_cassette('examples/audit/21', record: :none) do
294
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186852'
295
- Pubnub::Audit.any_instance.stub(:signature).and_return 'DYgPQnA92yetJq9KbQxSsLhRGHlaNHnjSRYIvLPSitA='
296
- envelope = @pubnub.audit(auth_key: 'key', channel_group: :demo, http_sync: true, &@callback)
297
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
298
- expect(envelope.error?).to eq false
169
+ it "__auth_key___key____channel___demo____channel_group__nil___http_sync__true___callback___lambda_" do
170
+ VCR.use_cassette("examples/audit/4", record: :none) do
171
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186848"
172
+ Pubnub::Audit.any_instance.stub(:signature).and_return "NXoP5si5ESsJjDhJck3EpkhfEeB49Km0R9w-XSutrto="
173
+ envelope = @pubnub.audit(auth_key: "key", channel: "demo", http_sync: true, callback: @callback)
174
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
175
+ expect(envelope.error?).to eq false
176
+
177
+ expect(envelope.status[:code]).to eq(200)
178
+ expect(envelope.status[:category]).to eq(:ack)
179
+ 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"})
180
+
181
+ expect(envelope.result[:code]).to eq(200)
182
+ expect(envelope.result[:operation]).to eq(:audit)
183
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
184
+ end
185
+ end
299
186
 
300
- expect(envelope.status[:code]).to eq(200)
301
- expect(envelope.status[:category]).to eq(:ack)
302
- 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"})
187
+ it "__auth_key___key____channel___demo____channel_group__nil___http_sync__false___callback__nil_" do
188
+ VCR.use_cassette("examples/audit/2", record: :none) do
189
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187024"
190
+ Pubnub::Audit.any_instance.stub(:signature).and_return "29x7wwIMVzIsnIo-pb6Yj0cxRMM1V_IkjePBFvQ169w="
191
+ envelope = @pubnub.audit(auth_key: "key", channel: "demo", http_sync: false)
192
+ envelope = envelope.value
193
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
194
+ expect(envelope.error?).to eq false
195
+
196
+ expect(envelope.status[:code]).to eq(200)
197
+ expect(envelope.status[:category]).to eq(:ack)
198
+ 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"})
199
+
200
+ expect(envelope.result[:code]).to eq(200)
201
+ expect(envelope.result[:operation]).to eq(:audit)
202
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
203
+ end
204
+ end
303
205
 
304
- expect(envelope.result[:code]).to eq(200)
305
- expect(envelope.result[:operation]).to eq(:audit)
306
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
206
+ it "__auth_key___key____channel___demo____channel_group__nil___http_sync__false___callback___block_" do
207
+ VCR.use_cassette("examples/audit/0", record: :none) do
208
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186849"
209
+ Pubnub::Audit.any_instance.stub(:signature).and_return "HUsH3eyTPCiYR_5gQ2YefizV6SswirTY5eaGHhsXbGw="
210
+ envelope = @pubnub.audit(auth_key: "key", channel: "demo", http_sync: false, &@callback)
211
+ envelope = envelope.value
212
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
213
+ expect(envelope.error?).to eq false
214
+
215
+ expect(envelope.status[:code]).to eq(200)
216
+ expect(envelope.status[:category]).to eq(:ack)
217
+ 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"})
218
+
219
+ expect(envelope.result[:code]).to eq(200)
220
+ expect(envelope.result[:operation]).to eq(:audit)
221
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
222
+ end
223
+ end
307
224
 
308
- end
309
- end
225
+ it "__auth_key___key____channel___demo____channel_group__nil___http_sync__false___callback___lambda_" do
226
+ VCR.use_cassette("examples/audit/1", record: :none) do
227
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187176"
228
+ Pubnub::Audit.any_instance.stub(:signature).and_return "zxDcoxKlyAvaeNvZ-W8i5DfEyQd2n_F-xrZtRbBAy4I="
229
+ envelope = @pubnub.audit(auth_key: "key", channel: "demo", http_sync: false, callback: @callback)
230
+ envelope = envelope.value
231
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
232
+ expect(envelope.error?).to eq false
233
+
234
+ expect(envelope.status[:code]).to eq(200)
235
+ expect(envelope.status[:category]).to eq(:ack)
236
+ 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"})
237
+
238
+ expect(envelope.result[:code]).to eq(200)
239
+ expect(envelope.result[:operation]).to eq(:audit)
240
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
241
+ end
242
+ end
310
243
 
244
+ it "__auth_key___key____channel__nil___channel_group___demo___http_sync__true___callback__nil_" do
245
+ VCR.use_cassette("examples/audit/23", record: :none) do
246
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186850"
247
+ Pubnub::Audit.any_instance.stub(:signature).and_return "e7K35-o7JSo_hb9BQ-mngvBeLSehMkK9WRmyXDgNnYs="
248
+ envelope = @pubnub.audit(auth_key: "key", channel_group: :demo, http_sync: true)
249
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
250
+ expect(envelope.error?).to eq false
251
+
252
+ expect(envelope.status[:code]).to eq(200)
253
+ expect(envelope.status[:category]).to eq(:ack)
254
+ 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"})
255
+
256
+ expect(envelope.result[:code]).to eq(200)
257
+ expect(envelope.result[:operation]).to eq(:audit)
258
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
259
+ end
260
+ end
311
261
 
312
- it '__auth_key___key____channel__nil___channel_group___demo___http_sync__true___callback___lambda_' do
313
- VCR.use_cassette('examples/audit/22', record: :none) do
314
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186853'
315
- Pubnub::Audit.any_instance.stub(:signature).and_return '49a7LhCsjBuTvkU9K9ykAc9Lkx6AxgrS1XG889huW1k='
316
- envelope = @pubnub.audit(auth_key: 'key', channel_group: :demo, http_sync: true, callback: @callback)
317
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
318
- expect(envelope.error?).to eq false
262
+ it "__auth_key___key____channel__nil___channel_group___demo___http_sync__true___callback___block_" do
263
+ VCR.use_cassette("examples/audit/21", record: :none) do
264
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186852"
265
+ Pubnub::Audit.any_instance.stub(:signature).and_return "DYgPQnA92yetJq9KbQxSsLhRGHlaNHnjSRYIvLPSitA="
266
+ envelope = @pubnub.audit(auth_key: "key", channel_group: :demo, http_sync: true, &@callback)
267
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
268
+ expect(envelope.error?).to eq false
269
+
270
+ expect(envelope.status[:code]).to eq(200)
271
+ expect(envelope.status[:category]).to eq(:ack)
272
+ 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"})
273
+
274
+ expect(envelope.result[:code]).to eq(200)
275
+ expect(envelope.result[:operation]).to eq(:audit)
276
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
277
+ end
278
+ end
319
279
 
320
- expect(envelope.status[:code]).to eq(200)
321
- expect(envelope.status[:category]).to eq(:ack)
322
- 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"})
280
+ it "__auth_key___key____channel__nil___channel_group___demo___http_sync__true___callback___lambda_" do
281
+ VCR.use_cassette("examples/audit/22", record: :none) do
282
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186853"
283
+ Pubnub::Audit.any_instance.stub(:signature).and_return "49a7LhCsjBuTvkU9K9ykAc9Lkx6AxgrS1XG889huW1k="
284
+ envelope = @pubnub.audit(auth_key: "key", channel_group: :demo, http_sync: true, callback: @callback)
285
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
286
+ expect(envelope.error?).to eq false
287
+
288
+ expect(envelope.status[:code]).to eq(200)
289
+ expect(envelope.status[:category]).to eq(:ack)
290
+ 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"})
291
+
292
+ expect(envelope.result[:code]).to eq(200)
293
+ expect(envelope.result[:operation]).to eq(:audit)
294
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
295
+ end
296
+ end
323
297
 
324
- expect(envelope.result[:code]).to eq(200)
325
- expect(envelope.result[:operation]).to eq(:audit)
326
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
298
+ it "__auth_key___key____channel__nil___channel_group___demo___http_sync__false___callback__nil_" do
299
+ VCR.use_cassette("examples/audit/20", record: :none) do
300
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186853"
301
+ Pubnub::Audit.any_instance.stub(:signature).and_return "49a7LhCsjBuTvkU9K9ykAc9Lkx6AxgrS1XG889huW1k="
302
+ envelope = @pubnub.audit(auth_key: "key", channel_group: :demo, http_sync: false)
303
+ envelope = envelope.value
304
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
305
+ expect(envelope.error?).to eq false
306
+
307
+ expect(envelope.status[:code]).to eq(200)
308
+ expect(envelope.status[:category]).to eq(:ack)
309
+ 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"})
310
+
311
+ expect(envelope.result[:code]).to eq(200)
312
+ expect(envelope.result[:operation]).to eq(:audit)
313
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
314
+ end
315
+ end
327
316
 
328
- end
329
- end
317
+ it "__auth_key___key____channel__nil___channel_group___demo___http_sync__false___callback___block_" do
318
+ VCR.use_cassette("examples/audit/18", record: :none) do
319
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187177"
320
+ Pubnub::Audit.any_instance.stub(:signature).and_return "bbwfIwB8oOCFDEsGasGCcRxaP47z00fvfDQQmXJpSa0="
321
+ envelope = @pubnub.audit(auth_key: "key", channel_group: :demo, http_sync: false, &@callback)
322
+ envelope = envelope.value
323
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
324
+ expect(envelope.error?).to eq false
325
+
326
+ expect(envelope.status[:code]).to eq(200)
327
+ expect(envelope.status[:category]).to eq(:ack)
328
+ 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"})
329
+
330
+ expect(envelope.result[:code]).to eq(200)
331
+ expect(envelope.result[:operation]).to eq(:audit)
332
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
333
+ end
334
+ end
330
335
 
336
+ it "__auth_key___key____channel__nil___channel_group___demo___http_sync__false___callback___lambda_" do
337
+ VCR.use_cassette("examples/audit/19", record: :none) do
338
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186854"
339
+ Pubnub::Audit.any_instance.stub(:signature).and_return "M-KnF7e_7v-iUn3SO8PGkXy02SQREti9_YtlphWc8Qs="
340
+ envelope = @pubnub.audit(auth_key: "key", channel_group: :demo, http_sync: false, callback: @callback)
341
+ envelope = envelope.value
342
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
343
+ expect(envelope.error?).to eq false
344
+
345
+ expect(envelope.status[:code]).to eq(200)
346
+ expect(envelope.status[:category]).to eq(:ack)
347
+ 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"})
348
+
349
+ expect(envelope.result[:code]).to eq(200)
350
+ expect(envelope.result[:operation]).to eq(:audit)
351
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
352
+ end
353
+ end
331
354
 
332
- it '__auth_key___key____channel__nil___channel_group___demo___http_sync__false___callback__nil_' do
333
- VCR.use_cassette('examples/audit/20', record: :none) do
334
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186853'
335
- Pubnub::Audit.any_instance.stub(:signature).and_return '49a7LhCsjBuTvkU9K9ykAc9Lkx6AxgrS1XG889huW1k='
336
- envelope = @pubnub.audit(auth_key: 'key', channel_group: :demo, http_sync: false)
337
- envelope = envelope.value
338
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
339
- expect(envelope.error?).to eq false
355
+ it "__auth_key___key____channel__nil___channel_group___demo____http_sync__true___callback__nil_" do
356
+ VCR.use_cassette("examples/audit/17", record: :none) do
357
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186855"
358
+ Pubnub::Audit.any_instance.stub(:signature).and_return "NA1NFJPGb5pWDbpizMeomPRyeVFS-WLHpqHZaKCaF38="
359
+ envelope = @pubnub.audit(auth_key: "key", channel_group: "demo", http_sync: true)
360
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
361
+ expect(envelope.error?).to eq false
362
+
363
+ expect(envelope.status[:code]).to eq(200)
364
+ expect(envelope.status[:category]).to eq(:ack)
365
+ 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"})
366
+
367
+ expect(envelope.result[:code]).to eq(200)
368
+ expect(envelope.result[:operation]).to eq(:audit)
369
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
370
+ end
371
+ end
340
372
 
341
- expect(envelope.status[:code]).to eq(200)
342
- expect(envelope.status[:category]).to eq(:ack)
343
- 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"})
373
+ it "__auth_key___key____channel__nil___channel_group___demo____http_sync__true___callback___block_" do
374
+ VCR.use_cassette("examples/audit/15", record: :none) do
375
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186856"
376
+ Pubnub::Audit.any_instance.stub(:signature).and_return "tHV8HKGgqs3x3gobrvkqQDIvJ6Toez0Yoqd4NwxFdow="
377
+ envelope = @pubnub.audit(auth_key: "key", channel_group: "demo", http_sync: true, &@callback)
378
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
379
+ expect(envelope.error?).to eq false
380
+
381
+ expect(envelope.status[:code]).to eq(200)
382
+ expect(envelope.status[:category]).to eq(:ack)
383
+ 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"})
384
+
385
+ expect(envelope.result[:code]).to eq(200)
386
+ expect(envelope.result[:operation]).to eq(:audit)
387
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
388
+ end
389
+ end
344
390
 
345
- expect(envelope.result[:code]).to eq(200)
346
- expect(envelope.result[:operation]).to eq(:audit)
347
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
391
+ it "__auth_key___key____channel__nil___channel_group___demo____http_sync__true___callback___lambda_" do
392
+ VCR.use_cassette("examples/audit/16", record: :none) do
393
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186856"
394
+ Pubnub::Audit.any_instance.stub(:signature).and_return "tHV8HKGgqs3x3gobrvkqQDIvJ6Toez0Yoqd4NwxFdow="
395
+ envelope = @pubnub.audit(auth_key: "key", channel_group: "demo", http_sync: true, callback: @callback)
396
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
397
+ expect(envelope.error?).to eq false
398
+
399
+ expect(envelope.status[:code]).to eq(200)
400
+ expect(envelope.status[:category]).to eq(:ack)
401
+ 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"})
402
+
403
+ expect(envelope.result[:code]).to eq(200)
404
+ expect(envelope.result[:operation]).to eq(:audit)
405
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
406
+ end
407
+ end
348
408
 
349
- end
350
- end
409
+ it "__auth_key___key____channel__nil___channel_group___demo____http_sync__false___callback__nil_" do
410
+ VCR.use_cassette("examples/audit/14", record: :none) do
411
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187026"
412
+ Pubnub::Audit.any_instance.stub(:signature).and_return "UEIbIDJHe4JwvFBnRnIpasW0eMk_bomC8-eaiOKFH08="
413
+ envelope = @pubnub.audit(auth_key: "key", channel_group: "demo", http_sync: false)
414
+ envelope = envelope.value
415
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
416
+ expect(envelope.error?).to eq false
417
+
418
+ expect(envelope.status[:code]).to eq(200)
419
+ expect(envelope.status[:category]).to eq(:ack)
420
+ 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"})
421
+
422
+ expect(envelope.result[:code]).to eq(200)
423
+ expect(envelope.result[:operation]).to eq(:audit)
424
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
425
+ end
426
+ end
351
427
 
428
+ it "__auth_key___key____channel__nil___channel_group___demo____http_sync__false___callback___block_" do
429
+ VCR.use_cassette("examples/audit/12", record: :none) do
430
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186857"
431
+ Pubnub::Audit.any_instance.stub(:signature).and_return "rmHnzE7AJ44yE24WnHYBJ7qXNUV_VO-9nLfk2n4I8H8="
432
+ envelope = @pubnub.audit(auth_key: "key", channel_group: "demo", http_sync: false, &@callback)
433
+ envelope = envelope.value
434
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
435
+ expect(envelope.error?).to eq false
436
+
437
+ expect(envelope.status[:code]).to eq(200)
438
+ expect(envelope.status[:category]).to eq(:ack)
439
+ 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"})
440
+
441
+ expect(envelope.result[:code]).to eq(200)
442
+ expect(envelope.result[:operation]).to eq(:audit)
443
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
444
+ end
445
+ end
352
446
 
353
- it '__auth_key___key____channel__nil___channel_group___demo___http_sync__false___callback___block_' do
354
- VCR.use_cassette('examples/audit/18', record: :none) do
355
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187177'
356
- Pubnub::Audit.any_instance.stub(:signature).and_return 'bbwfIwB8oOCFDEsGasGCcRxaP47z00fvfDQQmXJpSa0='
357
- envelope = @pubnub.audit(auth_key: 'key', channel_group: :demo, http_sync: false, &@callback)
358
- envelope = envelope.value
359
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
360
- expect(envelope.error?).to eq false
447
+ it "__auth_key___key____channel__nil___channel_group___demo____http_sync__false___callback___lambda_" do
448
+ VCR.use_cassette("examples/audit/13", record: :none) do
449
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187179"
450
+ Pubnub::Audit.any_instance.stub(:signature).and_return "47CV5KR4pEoYKTS6_q4y3vXOjzq9DYC9dRpWz-4glzM="
451
+ envelope = @pubnub.audit(auth_key: "key", channel_group: "demo", http_sync: false, callback: @callback)
452
+ envelope = envelope.value
453
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
454
+ expect(envelope.error?).to eq false
455
+
456
+ expect(envelope.status[:code]).to eq(200)
457
+ expect(envelope.status[:category]).to eq(:ack)
458
+ 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"})
459
+
460
+ expect(envelope.result[:code]).to eq(200)
461
+ expect(envelope.result[:operation]).to eq(:audit)
462
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
463
+ end
464
+ end
361
465
 
362
- expect(envelope.status[:code]).to eq(200)
363
- expect(envelope.status[:category]).to eq(:ack)
364
- 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"})
466
+ it "__auth_key___key____channel__nil___channel_group__nil___http_sync__true___callback__nil_" do
467
+ VCR.use_cassette("examples/audit/29", record: :none) do
468
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186858"
469
+ Pubnub::Audit.any_instance.stub(:signature).and_return "dgjBlW8dNAdEpyi8Mv7QcXY9_cxvrTlhCPnEsiexPJU="
470
+ envelope = @pubnub.audit(auth_key: "key", http_sync: true)
471
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
472
+ expect(envelope.error?).to eq false
473
+
474
+ expect(envelope.status[:code]).to eq(200)
475
+ expect(envelope.status[:category]).to eq(:ack)
476
+ 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"})
477
+
478
+ expect(envelope.result[:code]).to eq(200)
479
+ expect(envelope.result[:operation]).to eq(:audit)
480
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 0, "ttl" => 287}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1441}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1441, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 137}}}}})
481
+ end
482
+ end
365
483
 
366
- expect(envelope.result[:code]).to eq(200)
367
- expect(envelope.result[:operation]).to eq(:audit)
368
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
484
+ it "__auth_key___key____channel__nil___channel_group__nil___http_sync__true___callback___block_" do
485
+ VCR.use_cassette("examples/audit/27", record: :none) do
486
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186860"
487
+ Pubnub::Audit.any_instance.stub(:signature).and_return "u1l9yustVc-pGEn0HlJOhIS92jZZ-t0f5pUxHtnY96c="
488
+ envelope = @pubnub.audit(auth_key: "key", http_sync: true, &@callback)
489
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
490
+ expect(envelope.error?).to eq false
491
+
492
+ expect(envelope.status[:code]).to eq(200)
493
+ expect(envelope.status[:category]).to eq(:ack)
494
+ 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"})
495
+
496
+ expect(envelope.result[:code]).to eq(200)
497
+ expect(envelope.result[:operation]).to eq(:audit)
498
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 0, "ttl" => 287}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1441, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 137}}}}})
499
+ end
500
+ end
369
501
 
370
- end
371
- end
502
+ it "__auth_key___key____channel__nil___channel_group__nil___http_sync__true___callback___lambda_" do
503
+ VCR.use_cassette("examples/audit/28", record: :none) do
504
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186862"
505
+ Pubnub::Audit.any_instance.stub(:signature).and_return "rDnYUUgtiji8KV5x3aynVC6UtxyamTvA_A8vyoVgxP8="
506
+ envelope = @pubnub.audit(auth_key: "key", http_sync: true, callback: @callback)
507
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
508
+ expect(envelope.error?).to eq false
509
+
510
+ expect(envelope.status[:code]).to eq(200)
511
+ expect(envelope.status[:category]).to eq(:ack)
512
+ 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"})
513
+
514
+ expect(envelope.result[:code]).to eq(200)
515
+ expect(envelope.result[:operation]).to eq(:audit)
516
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 0, "ttl" => 287}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 137}}}}})
517
+ end
518
+ end
372
519
 
520
+ it "__auth_key___key____channel__nil___channel_group__nil___http_sync__false___callback__nil_" do
521
+ VCR.use_cassette("examples/audit/26", record: :none) do
522
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187180"
523
+ Pubnub::Audit.any_instance.stub(:signature).and_return "9wkrJlRhyUBRqSlFvTbNTWn-xKLvzL11IzhCnf0oqec="
524
+ envelope = @pubnub.audit(auth_key: "key", http_sync: false)
525
+ envelope = envelope.value
526
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
527
+ expect(envelope.error?).to eq false
528
+
529
+ expect(envelope.status[:code]).to eq(200)
530
+ expect(envelope.status[:category]).to eq(:ack)
531
+ 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"})
532
+
533
+ expect(envelope.result[:code]).to eq(200)
534
+ expect(envelope.result[:operation]).to eq(:audit)
535
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 4}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 4}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 131}}}}})
536
+ end
537
+ end
373
538
 
374
- it '__auth_key___key____channel__nil___channel_group___demo___http_sync__false___callback___lambda_' do
375
- VCR.use_cassette('examples/audit/19', record: :none) do
376
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186854'
377
- Pubnub::Audit.any_instance.stub(:signature).and_return 'M-KnF7e_7v-iUn3SO8PGkXy02SQREti9_YtlphWc8Qs='
378
- envelope = @pubnub.audit(auth_key: 'key', channel_group: :demo, http_sync: false, callback: @callback)
379
- envelope = envelope.value
380
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
381
- expect(envelope.error?).to eq false
539
+ it "__auth_key___key____channel__nil___channel_group__nil___http_sync__false___callback___block_" do
540
+ VCR.use_cassette("examples/audit/24", record: :none) do
541
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187181"
542
+ Pubnub::Audit.any_instance.stub(:signature).and_return "tsn5u0yycPJCZYK-vkbQ2oF18TtXsSlJYufJkjo8TWA="
543
+ envelope = @pubnub.audit(auth_key: "key", http_sync: false, &@callback)
544
+ envelope = envelope.value
545
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
546
+ expect(envelope.error?).to eq false
547
+
548
+ expect(envelope.status[:code]).to eq(200)
549
+ expect(envelope.status[:category]).to eq(:ack)
550
+ 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"})
551
+
552
+ expect(envelope.result[:code]).to eq(200)
553
+ expect(envelope.result[:operation]).to eq(:audit)
554
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 4}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 4}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 131}}}}})
555
+ end
556
+ end
382
557
 
383
- expect(envelope.status[:code]).to eq(200)
384
- expect(envelope.status[:category]).to eq(:ack)
385
- 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"})
558
+ it "__auth_key___key____channel__nil___channel_group__nil___http_sync__false___callback___lambda_" do
559
+ VCR.use_cassette("examples/audit/25", record: :none) do
560
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186863"
561
+ Pubnub::Audit.any_instance.stub(:signature).and_return "9RN6L5X-Nu3T12G5ZWloZCk3c0CEr0SvnSmR7R5WdGE="
562
+ envelope = @pubnub.audit(auth_key: "key", http_sync: false, callback: @callback)
563
+ envelope = envelope.value
564
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
565
+ expect(envelope.error?).to eq false
566
+
567
+ expect(envelope.status[:code]).to eq(200)
568
+ expect(envelope.status[:category]).to eq(:ack)
569
+ 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"})
570
+
571
+ expect(envelope.result[:code]).to eq(200)
572
+ expect(envelope.result[:operation]).to eq(:audit)
573
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 0, "ttl" => 287}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 137}}}}})
574
+ end
575
+ end
386
576
 
387
- expect(envelope.result[:code]).to eq(200)
388
- expect(envelope.result[:operation]).to eq(:audit)
389
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
577
+ it "__auth_key___key___channel___demo___channel_group__nil___http_sync__true___callback__nil_" do
578
+ VCR.use_cassette("examples/audit/41", record: :none) do
579
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464697015"
580
+ Pubnub::Audit.any_instance.stub(:signature).and_return "5ZfjOxWir6bGaGkEP4eUH-767wTFN_ssDaoWep4Hkb0="
581
+ envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: true)
582
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
583
+ expect(envelope.error?).to eq false
584
+
585
+ expect(envelope.status[:code]).to eq(200)
586
+ expect(envelope.status[:category]).to eq(:ack)
587
+ 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"})
588
+
589
+ expect(envelope.result[:code]).to eq(200)
590
+ expect(envelope.result[:operation]).to eq(:audit)
591
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
592
+ end
593
+ end
390
594
 
391
- end
392
- end
595
+ it "__auth_key___key___channel___demo___channel_group__nil___http_sync__true___callback___block_" do
596
+ VCR.use_cassette("examples/audit/39", record: :none) do
597
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186866"
598
+ Pubnub::Audit.any_instance.stub(:signature).and_return "usnDxndAATqV1coJa4gi98wXpZqZeABZfVnaB8Wj1qw="
599
+ envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: true, &@callback)
600
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
601
+ expect(envelope.error?).to eq false
602
+
603
+ expect(envelope.status[:code]).to eq(200)
604
+ expect(envelope.status[:category]).to eq(:ack)
605
+ 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"})
606
+
607
+ expect(envelope.result[:code]).to eq(200)
608
+ expect(envelope.result[:operation]).to eq(:audit)
609
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
610
+ end
611
+ end
393
612
 
613
+ it "__auth_key___key___channel___demo___channel_group__nil___http_sync__true___callback___lambda_" do
614
+ VCR.use_cassette("examples/audit/40", record: :none) do
615
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186867"
616
+ Pubnub::Audit.any_instance.stub(:signature).and_return "ABUVcFuZjtM-cwXrzr75SnERRqEaVkvc-W0WoB4tWTQ="
617
+ envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: true, callback: @callback)
618
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
619
+ expect(envelope.error?).to eq false
620
+
621
+ expect(envelope.status[:code]).to eq(200)
622
+ expect(envelope.status[:category]).to eq(:ack)
623
+ 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"})
624
+
625
+ expect(envelope.result[:code]).to eq(200)
626
+ expect(envelope.result[:operation]).to eq(:audit)
627
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
628
+ end
629
+ end
394
630
 
395
- it '__auth_key___key____channel__nil___channel_group___demo____http_sync__true___callback__nil_' do
396
- VCR.use_cassette('examples/audit/17', record: :none) do
397
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186855'
398
- Pubnub::Audit.any_instance.stub(:signature).and_return 'NA1NFJPGb5pWDbpizMeomPRyeVFS-WLHpqHZaKCaF38='
399
- envelope = @pubnub.audit(auth_key: 'key', channel_group: 'demo', http_sync: true)
400
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
401
- expect(envelope.error?).to eq false
631
+ it "__auth_key___key___channel___demo___channel_group__nil___http_sync__false___callback__nil_" do
632
+ VCR.use_cassette("examples/audit/38", record: :none) do
633
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464697103"
634
+ Pubnub::Audit.any_instance.stub(:signature).and_return "BE23sz5fM0NFfOnj5tY517l-kDbUt9k-gHToxlZ31oc="
635
+ envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: false)
636
+ envelope = envelope.value
637
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
638
+ expect(envelope.error?).to eq false
639
+
640
+ expect(envelope.status[:code]).to eq(200)
641
+ expect(envelope.status[:category]).to eq(:ack)
642
+ 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"})
643
+
644
+ expect(envelope.result[:code]).to eq(200)
645
+ expect(envelope.result[:operation]).to eq(:audit)
646
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
647
+ end
648
+ end
402
649
 
403
- expect(envelope.status[:code]).to eq(200)
404
- expect(envelope.status[:category]).to eq(:ack)
405
- 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"})
650
+ it "__auth_key___key___channel___demo___channel_group__nil___http_sync__false___callback___block_" do
651
+ VCR.use_cassette("examples/audit/36", record: :none) do
652
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187183"
653
+ Pubnub::Audit.any_instance.stub(:signature).and_return "cDNc_FY2QVP6yEC_G0IILwDxYKppEmHsWTV3HN8nas8="
654
+ envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: false, &@callback)
655
+ envelope = envelope.value
656
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
657
+ expect(envelope.error?).to eq false
658
+
659
+ expect(envelope.status[:code]).to eq(200)
660
+ expect(envelope.status[:category]).to eq(:ack)
661
+ 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"})
662
+
663
+ expect(envelope.result[:code]).to eq(200)
664
+ expect(envelope.result[:operation]).to eq(:audit)
665
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
666
+ end
667
+ end
406
668
 
407
- expect(envelope.result[:code]).to eq(200)
408
- expect(envelope.result[:operation]).to eq(:audit)
409
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
669
+ it "__auth_key___key___channel___demo___channel_group__nil___http_sync__false___callback___lambda_" do
670
+ VCR.use_cassette("examples/audit/37", record: :none) do
671
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187029"
672
+ Pubnub::Audit.any_instance.stub(:signature).and_return "owH-615JpjXjMH9BE-wqxSwHQb2iNT7GZAfuiNDV13A="
673
+ envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: false, callback: @callback)
674
+ envelope = envelope.value
675
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
676
+ expect(envelope.error?).to eq false
677
+
678
+ expect(envelope.status[:code]).to eq(200)
679
+ expect(envelope.status[:category]).to eq(:ack)
680
+ 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"})
681
+
682
+ expect(envelope.result[:code]).to eq(200)
683
+ expect(envelope.result[:operation]).to eq(:audit)
684
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
685
+ end
686
+ end
410
687
 
411
- end
412
- end
688
+ it "__auth_key___key___channel___demo____channel_group__nil___http_sync__true___callback__nil_" do
689
+ VCR.use_cassette("examples/audit/35", record: :none) do
690
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186868"
691
+ Pubnub::Audit.any_instance.stub(:signature).and_return "xsUvKRUuuN2uvZxPusRjwUoR8A_aAlGrVad6mwTVWBg="
692
+ envelope = @pubnub.audit(auth_key: :key, channel: "demo", http_sync: true)
693
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
694
+ expect(envelope.error?).to eq false
695
+
696
+ expect(envelope.status[:code]).to eq(200)
697
+ expect(envelope.status[:category]).to eq(:ack)
698
+ 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"})
699
+
700
+ expect(envelope.result[:code]).to eq(200)
701
+ expect(envelope.result[:operation]).to eq(:audit)
702
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
703
+ end
704
+ end
413
705
 
706
+ it "__auth_key___key___channel___demo____channel_group__nil___http_sync__true___callback___block_" do
707
+ VCR.use_cassette("examples/audit/33", record: :none) do
708
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186870"
709
+ Pubnub::Audit.any_instance.stub(:signature).and_return "pHjJryzjA3ZV9KbsGXRPfj97hAxptOGFiwO-Mr8Rq6Y="
710
+ envelope = @pubnub.audit(auth_key: :key, channel: "demo", http_sync: true, &@callback)
711
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
712
+ expect(envelope.error?).to eq false
713
+
714
+ expect(envelope.status[:code]).to eq(200)
715
+ expect(envelope.status[:category]).to eq(:ack)
716
+ 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"})
717
+
718
+ expect(envelope.result[:code]).to eq(200)
719
+ expect(envelope.result[:operation]).to eq(:audit)
720
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
721
+ end
722
+ end
414
723
 
415
- it '__auth_key___key____channel__nil___channel_group___demo____http_sync__true___callback___block_' do
416
- VCR.use_cassette('examples/audit/15', record: :none) do
417
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186856'
418
- Pubnub::Audit.any_instance.stub(:signature).and_return 'tHV8HKGgqs3x3gobrvkqQDIvJ6Toez0Yoqd4NwxFdow='
419
- envelope = @pubnub.audit(auth_key: 'key', channel_group: 'demo', http_sync: true, &@callback)
420
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
421
- expect(envelope.error?).to eq false
724
+ it "__auth_key___key___channel___demo____channel_group__nil___http_sync__true___callback___lambda_" do
725
+ VCR.use_cassette("examples/audit/34", record: :none) do
726
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186870"
727
+ Pubnub::Audit.any_instance.stub(:signature).and_return "pHjJryzjA3ZV9KbsGXRPfj97hAxptOGFiwO-Mr8Rq6Y="
728
+ envelope = @pubnub.audit(auth_key: :key, channel: "demo", http_sync: true, callback: @callback)
729
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
730
+ expect(envelope.error?).to eq false
731
+
732
+ expect(envelope.status[:code]).to eq(200)
733
+ expect(envelope.status[:category]).to eq(:ack)
734
+ 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"})
735
+
736
+ expect(envelope.result[:code]).to eq(200)
737
+ expect(envelope.result[:operation]).to eq(:audit)
738
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
739
+ end
740
+ end
422
741
 
423
- expect(envelope.status[:code]).to eq(200)
424
- expect(envelope.status[:category]).to eq(:ack)
425
- 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"})
742
+ it "__auth_key___key___channel___demo____channel_group__nil___http_sync__false___callback__nil_" do
743
+ VCR.use_cassette("examples/audit/32", record: :none) do
744
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186871"
745
+ Pubnub::Audit.any_instance.stub(:signature).and_return "B0RNLxxNNLm7iRCUv9mSQLg1YUORR35yFQsm86tNfWw="
746
+ envelope = @pubnub.audit(auth_key: :key, channel: "demo", http_sync: false)
747
+ envelope = envelope.value
748
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
749
+ expect(envelope.error?).to eq false
750
+
751
+ expect(envelope.status[:code]).to eq(200)
752
+ expect(envelope.status[:category]).to eq(:ack)
753
+ 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"})
754
+
755
+ expect(envelope.result[:code]).to eq(200)
756
+ expect(envelope.result[:operation]).to eq(:audit)
757
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
758
+ end
759
+ end
426
760
 
427
- expect(envelope.result[:code]).to eq(200)
428
- expect(envelope.result[:operation]).to eq(:audit)
429
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
761
+ it "__auth_key___key___channel___demo____channel_group__nil___http_sync__false___callback___block_" do
762
+ VCR.use_cassette("examples/audit/30", record: :none) do
763
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186872"
764
+ Pubnub::Audit.any_instance.stub(:signature).and_return "-h7c12J12qAHVvyFZExhv8DXo_C6ZOCz6Q-MwMvxrrE="
765
+ envelope = @pubnub.audit(auth_key: :key, channel: "demo", http_sync: false, &@callback)
766
+ envelope = envelope.value
767
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
768
+ expect(envelope.error?).to eq false
769
+
770
+ expect(envelope.status[:code]).to eq(200)
771
+ expect(envelope.status[:category]).to eq(:ack)
772
+ 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"})
773
+
774
+ expect(envelope.result[:code]).to eq(200)
775
+ expect(envelope.result[:operation]).to eq(:audit)
776
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
777
+ end
778
+ end
430
779
 
431
- end
432
- end
780
+ it "__auth_key___key___channel___demo____channel_group__nil___http_sync__false___callback___lambda_" do
781
+ VCR.use_cassette("examples/audit/31", record: :none) do
782
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187184"
783
+ Pubnub::Audit.any_instance.stub(:signature).and_return "NNkSqfTwlGTTYyZwz6ZkM8a92ZvDAaFRbwDwQAe-L2Q="
784
+ envelope = @pubnub.audit(auth_key: :key, channel: "demo", http_sync: false, callback: @callback)
785
+ envelope = envelope.value
786
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
787
+ expect(envelope.error?).to eq false
788
+
789
+ expect(envelope.status[:code]).to eq(200)
790
+ expect(envelope.status[:category]).to eq(:ack)
791
+ 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"})
792
+
793
+ expect(envelope.result[:code]).to eq(200)
794
+ expect(envelope.result[:operation]).to eq(:audit)
795
+ expect(envelope.result[:data]).to eq({"level" => "user", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel" => "demo", "auths" => {}})
796
+ end
797
+ end
433
798
 
799
+ it "__auth_key___key___channel__nil___channel_group___demo___http_sync__true___callback__nil_" do
800
+ VCR.use_cassette("examples/audit/53", record: :none) do
801
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186873"
802
+ Pubnub::Audit.any_instance.stub(:signature).and_return "Lb6Q2aZk5IB2Lrkwo25GtV1d34JHMG136w7tWf295rA="
803
+ envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: true)
804
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
805
+ expect(envelope.error?).to eq false
806
+
807
+ expect(envelope.status[:code]).to eq(200)
808
+ expect(envelope.status[:category]).to eq(:ack)
809
+ 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"})
810
+
811
+ expect(envelope.result[:code]).to eq(200)
812
+ expect(envelope.result[:operation]).to eq(:audit)
813
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
814
+ end
815
+ end
434
816
 
435
- it '__auth_key___key____channel__nil___channel_group___demo____http_sync__true___callback___lambda_' do
436
- VCR.use_cassette('examples/audit/16', record: :none) do
437
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186856'
438
- Pubnub::Audit.any_instance.stub(:signature).and_return 'tHV8HKGgqs3x3gobrvkqQDIvJ6Toez0Yoqd4NwxFdow='
439
- envelope = @pubnub.audit(auth_key: 'key', channel_group: 'demo', http_sync: true, callback: @callback)
440
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
441
- expect(envelope.error?).to eq false
817
+ it "__auth_key___key___channel__nil___channel_group___demo___http_sync__true___callback___block_" do
818
+ VCR.use_cassette("examples/audit/51", record: :none) do
819
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186873"
820
+ Pubnub::Audit.any_instance.stub(:signature).and_return "Lb6Q2aZk5IB2Lrkwo25GtV1d34JHMG136w7tWf295rA="
821
+ envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: true, &@callback)
822
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
823
+ expect(envelope.error?).to eq false
824
+
825
+ expect(envelope.status[:code]).to eq(200)
826
+ expect(envelope.status[:category]).to eq(:ack)
827
+ 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"})
828
+
829
+ expect(envelope.result[:code]).to eq(200)
830
+ expect(envelope.result[:operation]).to eq(:audit)
831
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
832
+ end
833
+ end
442
834
 
443
- expect(envelope.status[:code]).to eq(200)
444
- expect(envelope.status[:category]).to eq(:ack)
445
- 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"})
835
+ it "__auth_key___key___channel__nil___channel_group___demo___http_sync__true___callback___lambda_" do
836
+ VCR.use_cassette("examples/audit/52", record: :none) do
837
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186874"
838
+ Pubnub::Audit.any_instance.stub(:signature).and_return "PM7ONrJcAeIVvVMW4t8rPTu-eCCqwHNL4NX8J4rHyh8="
839
+ envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: true, callback: @callback)
840
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
841
+ expect(envelope.error?).to eq false
842
+
843
+ expect(envelope.status[:code]).to eq(200)
844
+ expect(envelope.status[:category]).to eq(:ack)
845
+ 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"})
846
+
847
+ expect(envelope.result[:code]).to eq(200)
848
+ expect(envelope.result[:operation]).to eq(:audit)
849
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
850
+ end
851
+ end
446
852
 
447
- expect(envelope.result[:code]).to eq(200)
448
- expect(envelope.result[:operation]).to eq(:audit)
449
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
853
+ it "__auth_key___key___channel__nil___channel_group___demo___http_sync__false___callback__nil_" do
854
+ VCR.use_cassette("examples/audit/50", record: :none) do
855
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186875"
856
+ Pubnub::Audit.any_instance.stub(:signature).and_return "8Liys-fFEhn5tIacHdq2AweRaTfgqaCLWd3i04WjEgs="
857
+ envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: false)
858
+ envelope = envelope.value
859
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
860
+ expect(envelope.error?).to eq false
861
+
862
+ expect(envelope.status[:code]).to eq(200)
863
+ expect(envelope.status[:category]).to eq(:ack)
864
+ 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"})
865
+
866
+ expect(envelope.result[:code]).to eq(200)
867
+ expect(envelope.result[:operation]).to eq(:audit)
868
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
869
+ end
870
+ end
450
871
 
451
- end
452
- end
872
+ it "__auth_key___key___channel__nil___channel_group___demo___http_sync__false___callback___block_" do
873
+ VCR.use_cassette("examples/audit/48", record: :none) do
874
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186875"
875
+ Pubnub::Audit.any_instance.stub(:signature).and_return "8Liys-fFEhn5tIacHdq2AweRaTfgqaCLWd3i04WjEgs="
876
+ envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: false, &@callback)
877
+ envelope = envelope.value
878
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
879
+ expect(envelope.error?).to eq false
880
+
881
+ expect(envelope.status[:code]).to eq(200)
882
+ expect(envelope.status[:category]).to eq(:ack)
883
+ 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"})
884
+
885
+ expect(envelope.result[:code]).to eq(200)
886
+ expect(envelope.result[:operation]).to eq(:audit)
887
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
888
+ end
889
+ end
453
890
 
891
+ it "__auth_key___key___channel__nil___channel_group___demo___http_sync__false___callback___lambda_" do
892
+ VCR.use_cassette("examples/audit/49", record: :none) do
893
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186876"
894
+ Pubnub::Audit.any_instance.stub(:signature).and_return "Z8ak07OMYU0nwKFi-i2AgeIGT0zMTmMgH6XChQM8En4="
895
+ envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: false, callback: @callback)
896
+ envelope = envelope.value
897
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
898
+ expect(envelope.error?).to eq false
899
+
900
+ expect(envelope.status[:code]).to eq(200)
901
+ expect(envelope.status[:category]).to eq(:ack)
902
+ 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"})
903
+
904
+ expect(envelope.result[:code]).to eq(200)
905
+ expect(envelope.result[:operation]).to eq(:audit)
906
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
907
+ end
908
+ end
454
909
 
455
- it '__auth_key___key____channel__nil___channel_group___demo____http_sync__false___callback__nil_' do
456
- VCR.use_cassette('examples/audit/14', record: :none) do
457
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187026'
458
- Pubnub::Audit.any_instance.stub(:signature).and_return 'UEIbIDJHe4JwvFBnRnIpasW0eMk_bomC8-eaiOKFH08='
459
- envelope = @pubnub.audit(auth_key: 'key', channel_group: 'demo', http_sync: false)
460
- envelope = envelope.value
461
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
462
- expect(envelope.error?).to eq false
910
+ it "__auth_key___key___channel__nil___channel_group___demo____http_sync__true___callback__nil_" do
911
+ VCR.use_cassette("examples/audit/47", record: :none) do
912
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186876"
913
+ Pubnub::Audit.any_instance.stub(:signature).and_return "Z8ak07OMYU0nwKFi-i2AgeIGT0zMTmMgH6XChQM8En4="
914
+ envelope = @pubnub.audit(auth_key: :key, channel_group: "demo", http_sync: true)
915
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
916
+ expect(envelope.error?).to eq false
917
+
918
+ expect(envelope.status[:code]).to eq(200)
919
+ expect(envelope.status[:category]).to eq(:ack)
920
+ 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"})
921
+
922
+ expect(envelope.result[:code]).to eq(200)
923
+ expect(envelope.result[:operation]).to eq(:audit)
924
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
925
+ end
926
+ end
463
927
 
464
- expect(envelope.status[:code]).to eq(200)
465
- expect(envelope.status[:category]).to eq(:ack)
466
- 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"})
928
+ it "__auth_key___key___channel__nil___channel_group___demo____http_sync__true___callback___block_" do
929
+ VCR.use_cassette("examples/audit/45", record: :none) do
930
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186877"
931
+ Pubnub::Audit.any_instance.stub(:signature).and_return "I86HpxwUA17o4B9wJDUMYByE_Pl02-3zSV2zvCl57Ms="
932
+ envelope = @pubnub.audit(auth_key: :key, channel_group: "demo", http_sync: true, &@callback)
933
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
934
+ expect(envelope.error?).to eq false
935
+
936
+ expect(envelope.status[:code]).to eq(200)
937
+ expect(envelope.status[:category]).to eq(:ack)
938
+ 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"})
939
+
940
+ expect(envelope.result[:code]).to eq(200)
941
+ expect(envelope.result[:operation]).to eq(:audit)
942
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
943
+ end
944
+ end
467
945
 
468
- expect(envelope.result[:code]).to eq(200)
469
- expect(envelope.result[:operation]).to eq(:audit)
470
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
946
+ it "__auth_key___key___channel__nil___channel_group___demo____http_sync__true___callback___lambda_" do
947
+ VCR.use_cassette("examples/audit/46", record: :none) do
948
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186878"
949
+ Pubnub::Audit.any_instance.stub(:signature).and_return "1DbUmg1E5EtNd_ngB11_3sxl-Z7vEZdvhyiCGmrdvys="
950
+ envelope = @pubnub.audit(auth_key: :key, channel_group: "demo", http_sync: true, callback: @callback)
951
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
952
+ expect(envelope.error?).to eq false
953
+
954
+ expect(envelope.status[:code]).to eq(200)
955
+ expect(envelope.status[:category]).to eq(:ack)
956
+ 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"})
957
+
958
+ expect(envelope.result[:code]).to eq(200)
959
+ expect(envelope.result[:operation]).to eq(:audit)
960
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
961
+ end
962
+ end
471
963
 
472
- end
473
- end
964
+ it "__auth_key___key___channel__nil___channel_group___demo____http_sync__false___callback__nil_" do
965
+ VCR.use_cassette("examples/audit/44", record: :none) do
966
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187185"
967
+ Pubnub::Audit.any_instance.stub(:signature).and_return "pflH9F0DGUisemPrvn7_hkBpcQsf0ccHQJBZvzkPpio="
968
+ envelope = @pubnub.audit(auth_key: :key, channel_group: "demo", http_sync: false)
969
+ envelope = envelope.value
970
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
971
+ expect(envelope.error?).to eq false
972
+
973
+ expect(envelope.status[:code]).to eq(200)
974
+ expect(envelope.status[:category]).to eq(:ack)
975
+ 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"})
976
+
977
+ expect(envelope.result[:code]).to eq(200)
978
+ expect(envelope.result[:operation]).to eq(:audit)
979
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
980
+ end
981
+ end
474
982
 
983
+ it "__auth_key___key___channel__nil___channel_group___demo____http_sync__false___callback___block_" do
984
+ VCR.use_cassette("examples/audit/42", record: :none) do
985
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187030"
986
+ Pubnub::Audit.any_instance.stub(:signature).and_return "cn9x4223RiNmk54DsBZ5Nym6b--AUOTcT4fwM9dJ2jw="
987
+ envelope = @pubnub.audit(auth_key: :key, channel_group: "demo", http_sync: false, &@callback)
988
+ envelope = envelope.value
989
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
990
+ expect(envelope.error?).to eq false
991
+
992
+ expect(envelope.status[:code]).to eq(200)
993
+ expect(envelope.status[:category]).to eq(:ack)
994
+ 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"})
995
+
996
+ expect(envelope.result[:code]).to eq(200)
997
+ expect(envelope.result[:operation]).to eq(:audit)
998
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
999
+ end
1000
+ end
475
1001
 
476
- it '__auth_key___key____channel__nil___channel_group___demo____http_sync__false___callback___block_' do
477
- VCR.use_cassette('examples/audit/12', record: :none) do
478
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186857'
479
- Pubnub::Audit.any_instance.stub(:signature).and_return 'rmHnzE7AJ44yE24WnHYBJ7qXNUV_VO-9nLfk2n4I8H8='
480
- envelope = @pubnub.audit(auth_key: 'key', channel_group: 'demo', http_sync: false, &@callback)
481
- envelope = envelope.value
482
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
483
- expect(envelope.error?).to eq false
1002
+ it "__auth_key___key___channel__nil___channel_group___demo____http_sync__false___callback___lambda_" do
1003
+ VCR.use_cassette("examples/audit/43", record: :none) do
1004
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187187"
1005
+ Pubnub::Audit.any_instance.stub(:signature).and_return "z9WKikWdsOotjTwmqs5lf1YLz1j1f8Q_A06BN1zriPo="
1006
+ envelope = @pubnub.audit(auth_key: :key, channel_group: "demo", http_sync: false, callback: @callback)
1007
+ envelope = envelope.value
1008
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1009
+ expect(envelope.error?).to eq false
1010
+
1011
+ expect(envelope.status[:code]).to eq(200)
1012
+ expect(envelope.status[:category]).to eq(:ack)
1013
+ 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"})
1014
+
1015
+ expect(envelope.result[:code]).to eq(200)
1016
+ expect(envelope.result[:operation]).to eq(:audit)
1017
+ expect(envelope.result[:data]).to eq({"level" => "channel-group+auth", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group" => "demo", "auths" => {}})
1018
+ end
1019
+ end
484
1020
 
485
- expect(envelope.status[:code]).to eq(200)
486
- expect(envelope.status[:category]).to eq(:ack)
487
- 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"})
1021
+ it "__auth_key___key___channel__nil___channel_group__nil___http_sync__true___callback__nil_" do
1022
+ VCR.use_cassette("examples/audit/59", record: :none) do
1023
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186880"
1024
+ Pubnub::Audit.any_instance.stub(:signature).and_return "o6qOMJqHZ8kwc6QFD3ZCQY1w1CqRfnHAGaR3-tnAFf0="
1025
+ envelope = @pubnub.audit(auth_key: :key, http_sync: true)
1026
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1027
+ expect(envelope.error?).to eq false
1028
+
1029
+ expect(envelope.status[:code]).to eq(200)
1030
+ expect(envelope.status[:category]).to eq(:ack)
1031
+ 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"})
1032
+
1033
+ expect(envelope.result[:code]).to eq(200)
1034
+ expect(envelope.result[:operation]).to eq(:audit)
1035
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 0, "ttl" => 286}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1441, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 136}}}}})
1036
+ end
1037
+ end
488
1038
 
489
- expect(envelope.result[:code]).to eq(200)
490
- expect(envelope.result[:operation]).to eq(:audit)
491
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
1039
+ it "__auth_key___key___channel__nil___channel_group__nil___http_sync__true___callback___block_" do
1040
+ VCR.use_cassette("examples/audit/57", record: :none) do
1041
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186882"
1042
+ Pubnub::Audit.any_instance.stub(:signature).and_return "lkXa7M-JXUXCvodcGfKRiUlYf8fg0hfVwngEGK6zN9g="
1043
+ envelope = @pubnub.audit(auth_key: :key, http_sync: true, &@callback)
1044
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1045
+ expect(envelope.error?).to eq false
1046
+
1047
+ expect(envelope.status[:code]).to eq(200)
1048
+ expect(envelope.status[:category]).to eq(:ack)
1049
+ 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"})
1050
+
1051
+ expect(envelope.result[:code]).to eq(200)
1052
+ expect(envelope.result[:operation]).to eq(:audit)
1053
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 0, "ttl" => 286}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 136}}}}})
1054
+ end
1055
+ end
492
1056
 
493
- end
494
- end
1057
+ it "__auth_key___key___channel__nil___channel_group__nil___http_sync__true___callback___lambda_" do
1058
+ VCR.use_cassette("examples/audit/58", record: :none) do
1059
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186885"
1060
+ Pubnub::Audit.any_instance.stub(:signature).and_return "pZjPZucMs0WP_2awPTm8_ms-_Pc2OF_lwrgfvHAF0dw="
1061
+ envelope = @pubnub.audit(auth_key: :key, http_sync: true, callback: @callback)
1062
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1063
+ expect(envelope.error?).to eq false
1064
+
1065
+ expect(envelope.status[:code]).to eq(200)
1066
+ expect(envelope.status[:category]).to eq(:ack)
1067
+ 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"})
1068
+
1069
+ expect(envelope.result[:code]).to eq(200)
1070
+ expect(envelope.result[:operation]).to eq(:audit)
1071
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 0, "ttl" => 286}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 9}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 136}}}}})
1072
+ end
1073
+ end
495
1074
 
1075
+ it "__auth_key___key___channel__nil___channel_group__nil___http_sync__false___callback__nil_" do
1076
+ VCR.use_cassette("examples/audit/56", record: :none) do
1077
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187188"
1078
+ Pubnub::Audit.any_instance.stub(:signature).and_return "qNi51Jq8iMdZzM5sPRlfzmovZTvXx3YqSl2s2NwnXwE="
1079
+ envelope = @pubnub.audit(auth_key: :key, http_sync: false)
1080
+ envelope = envelope.value
1081
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1082
+ expect(envelope.error?).to eq false
1083
+
1084
+ expect(envelope.status[:code]).to eq(200)
1085
+ expect(envelope.status[:category]).to eq(:ack)
1086
+ 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"})
1087
+
1088
+ expect(envelope.result[:code]).to eq(200)
1089
+ expect(envelope.result[:operation]).to eq(:audit)
1090
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 4}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 4}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 131}}}}})
1091
+ end
1092
+ end
496
1093
 
497
- it '__auth_key___key____channel__nil___channel_group___demo____http_sync__false___callback___lambda_' do
498
- VCR.use_cassette('examples/audit/13', record: :none) do
499
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187179'
500
- Pubnub::Audit.any_instance.stub(:signature).and_return '47CV5KR4pEoYKTS6_q4y3vXOjzq9DYC9dRpWz-4glzM='
501
- envelope = @pubnub.audit(auth_key: 'key', channel_group: 'demo', http_sync: false, callback: @callback)
502
- envelope = envelope.value
503
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
504
- expect(envelope.error?).to eq false
1094
+ it "__auth_key___key___channel__nil___channel_group__nil___http_sync__false___callback___block_" do
1095
+ VCR.use_cassette("examples/audit/54", record: :none) do
1096
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187031"
1097
+ Pubnub::Audit.any_instance.stub(:signature).and_return "7v-HexlXeKhnJ2BajRS2p97U4d6FFGtMakx1JrTMV3M="
1098
+ envelope = @pubnub.audit(auth_key: :key, http_sync: false, &@callback)
1099
+ envelope = envelope.value
1100
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1101
+ expect(envelope.error?).to eq false
1102
+
1103
+ expect(envelope.status[:code]).to eq(200)
1104
+ expect(envelope.status[:category]).to eq(:ack)
1105
+ 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"})
1106
+
1107
+ expect(envelope.result[:code]).to eq(200)
1108
+ expect(envelope.result[:operation]).to eq(:audit)
1109
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 6}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 6}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 134}}}}})
1110
+ end
1111
+ end
505
1112
 
506
- expect(envelope.status[:code]).to eq(200)
507
- expect(envelope.status[:category]).to eq(:ack)
508
- 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"})
1113
+ it "__auth_key___key___channel__nil___channel_group__nil___http_sync__false___callback___lambda_" do
1114
+ VCR.use_cassette("examples/audit/55", record: :none) do
1115
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187189"
1116
+ Pubnub::Audit.any_instance.stub(:signature).and_return "KegVli9MqXXPj3L-awtHyK-ekzfDXGw4k-3esnltka0="
1117
+ envelope = @pubnub.audit(auth_key: :key, http_sync: false, callback: @callback)
1118
+ envelope = envelope.value
1119
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1120
+ expect(envelope.error?).to eq false
1121
+
1122
+ expect(envelope.status[:code]).to eq(200)
1123
+ expect(envelope.status[:category]).to eq(:ack)
1124
+ 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"})
1125
+
1126
+ expect(envelope.result[:code]).to eq(200)
1127
+ expect(envelope.result[:operation]).to eq(:audit)
1128
+ expect(envelope.result[:data]).to eq({"level" => "subkey", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}, "ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 4}}}, "demo-pnpres" => {"r" => 1, "m" => 1, "w" => 1, "auths" => {"ADMIN-hb89skz71v" => {"r" => 1, "m" => 0, "w" => 1, "ttl" => 4}}}, "demo.*" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}, "objects" => {}, "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 131}}}}})
1129
+ end
1130
+ end
509
1131
 
510
- expect(envelope.result[:code]).to eq(200)
511
- expect(envelope.result[:operation]).to eq(:audit)
512
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
1132
+ it "__auth_key__nil___channel__nil___channel_group___demo___http_sync__true___callback__nil_" do
1133
+ VCR.use_cassette("examples/audit/71", record: :none) do
1134
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464697104"
1135
+ Pubnub::Audit.any_instance.stub(:signature).and_return "EQJKSlERla2RqqCa8ieN1-5yZcskBULnIz6YUqKSq8Q="
1136
+ envelope = @pubnub.audit(channel_group: :demo, http_sync: true)
1137
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1138
+ expect(envelope.error?).to eq false
1139
+
1140
+ expect(envelope.status[:code]).to eq(200)
1141
+ expect(envelope.status[:category]).to eq(:ack)
1142
+ 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"})
1143
+
1144
+ expect(envelope.result[:code]).to eq(200)
1145
+ expect(envelope.result[:operation]).to eq(:audit)
1146
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1439}}})
1147
+ end
1148
+ end
513
1149
 
514
- end
515
- end
1150
+ it "__auth_key__nil___channel__nil___channel_group___demo___http_sync__true___callback___block_" do
1151
+ VCR.use_cassette("examples/audit/69", record: :none) do
1152
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464697105"
1153
+ Pubnub::Audit.any_instance.stub(:signature).and_return "WCmluR0sUF-xGs8gksI2ZQU6w5VxZ55BhK3bo8jV1Bk="
1154
+ envelope = @pubnub.audit(channel_group: :demo, http_sync: true, &@callback)
1155
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1156
+ expect(envelope.error?).to eq false
1157
+
1158
+ expect(envelope.status[:code]).to eq(200)
1159
+ expect(envelope.status[:category]).to eq(:ack)
1160
+ 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"})
1161
+
1162
+ expect(envelope.result[:code]).to eq(200)
1163
+ expect(envelope.result[:operation]).to eq(:audit)
1164
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440}}})
1165
+ end
1166
+ end
516
1167
 
1168
+ it "__auth_key__nil___channel__nil___channel_group___demo___http_sync__true___callback___lambda_" do
1169
+ VCR.use_cassette("examples/audit/70", record: :none) do
1170
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186889"
1171
+ Pubnub::Audit.any_instance.stub(:signature).and_return "8g09A0BvUXUKgLwPFstHy9A44w4VI6qNW9-NqKafBaU="
1172
+ envelope = @pubnub.audit(channel_group: :demo, http_sync: true, callback: @callback)
1173
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1174
+ expect(envelope.error?).to eq false
1175
+
1176
+ expect(envelope.status[:code]).to eq(200)
1177
+ expect(envelope.status[:category]).to eq(:ack)
1178
+ 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"})
1179
+
1180
+ expect(envelope.result[:code]).to eq(200)
1181
+ expect(envelope.result[:operation]).to eq(:audit)
1182
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 136}}}}})
1183
+ end
1184
+ end
517
1185
 
518
- it '__auth_key___key____channel__nil___channel_group__nil___http_sync__true___callback__nil_' do
519
- VCR.use_cassette('examples/audit/29', record: :none) do
520
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186858'
521
- Pubnub::Audit.any_instance.stub(:signature).and_return 'dgjBlW8dNAdEpyi8Mv7QcXY9_cxvrTlhCPnEsiexPJU='
522
- envelope = @pubnub.audit(auth_key: 'key', http_sync: true)
523
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
524
- expect(envelope.error?).to eq false
1186
+ it "__auth_key__nil___channel__nil___channel_group___demo___http_sync__false___callback__nil_" do
1187
+ VCR.use_cassette("examples/audit/68", record: :none) do
1188
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187033"
1189
+ Pubnub::Audit.any_instance.stub(:signature).and_return "8eDkK8LRPtT_VnfyU1otEfGmKfi284g0gDS6yytGCQo="
1190
+ envelope = @pubnub.audit(channel_group: :demo, http_sync: false)
1191
+ envelope = envelope.value
1192
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1193
+ expect(envelope.error?).to eq false
1194
+
1195
+ expect(envelope.status[:code]).to eq(200)
1196
+ expect(envelope.status[:category]).to eq(:ack)
1197
+ 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"})
1198
+
1199
+ expect(envelope.result[:code]).to eq(200)
1200
+ expect(envelope.result[:operation]).to eq(:audit)
1201
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 134}}}}})
1202
+ end
1203
+ end
525
1204
 
526
- expect(envelope.status[:code]).to eq(200)
527
- expect(envelope.status[:category]).to eq(:ack)
528
- 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"})
1205
+ it "__auth_key__nil___channel__nil___channel_group___demo___http_sync__false___callback___block_" do
1206
+ VCR.use_cassette("examples/audit/66", record: :none) do
1207
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186890"
1208
+ Pubnub::Audit.any_instance.stub(:signature).and_return "EFlQZ2fQ756aPBryetYFd6EFMEuj1Ke9oCW5BpkFAi4="
1209
+ envelope = @pubnub.audit(channel_group: :demo, http_sync: false, &@callback)
1210
+ envelope = envelope.value
1211
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1212
+ expect(envelope.error?).to eq false
1213
+
1214
+ expect(envelope.status[:code]).to eq(200)
1215
+ expect(envelope.status[:category]).to eq(:ack)
1216
+ 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"})
1217
+
1218
+ expect(envelope.result[:code]).to eq(200)
1219
+ expect(envelope.result[:operation]).to eq(:audit)
1220
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 136}}}}})
1221
+ end
1222
+ end
529
1223
 
530
- expect(envelope.result[:code]).to eq(200)
531
- expect(envelope.result[:operation]).to eq(:audit)
532
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>0, "ttl"=>287}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1441}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1441, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>137}}}}})
1224
+ it "__auth_key__nil___channel__nil___channel_group___demo___http_sync__false___callback___lambda_" do
1225
+ VCR.use_cassette("examples/audit/67", record: :none) do
1226
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187033"
1227
+ Pubnub::Audit.any_instance.stub(:signature).and_return "8eDkK8LRPtT_VnfyU1otEfGmKfi284g0gDS6yytGCQo="
1228
+ envelope = @pubnub.audit(channel_group: :demo, http_sync: false, callback: @callback)
1229
+ envelope = envelope.value
1230
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1231
+ expect(envelope.error?).to eq false
1232
+
1233
+ expect(envelope.status[:code]).to eq(200)
1234
+ expect(envelope.status[:category]).to eq(:ack)
1235
+ 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"})
1236
+
1237
+ expect(envelope.result[:code]).to eq(200)
1238
+ expect(envelope.result[:operation]).to eq(:audit)
1239
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 134}}}}})
1240
+ end
1241
+ end
533
1242
 
534
- end
535
- end
1243
+ it "__auth_key__nil___channel__nil___channel_group___demo____http_sync__true___callback__nil_" do
1244
+ VCR.use_cassette("examples/audit/65", record: :none) do
1245
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186891"
1246
+ Pubnub::Audit.any_instance.stub(:signature).and_return "llWHzSYMTpc24K92E6ZhBACHbCOGqS4Dg-Fo94PjpR8="
1247
+ envelope = @pubnub.audit(channel_group: "demo", http_sync: true)
1248
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1249
+ expect(envelope.error?).to eq false
1250
+
1251
+ expect(envelope.status[:code]).to eq(200)
1252
+ expect(envelope.status[:category]).to eq(:ack)
1253
+ 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"})
1254
+
1255
+ expect(envelope.result[:code]).to eq(200)
1256
+ expect(envelope.result[:operation]).to eq(:audit)
1257
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 136}}}}})
1258
+ end
1259
+ end
536
1260
 
1261
+ it "__auth_key__nil___channel__nil___channel_group___demo____http_sync__true___callback___block_" do
1262
+ VCR.use_cassette("examples/audit/63", record: :none) do
1263
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186892"
1264
+ Pubnub::Audit.any_instance.stub(:signature).and_return "0Y4khklcMAg1rSpr4z-G_Hu7EjLWVWwgWJUEbRy7uVc="
1265
+ envelope = @pubnub.audit(channel_group: "demo", http_sync: true, &@callback)
1266
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1267
+ expect(envelope.error?).to eq false
1268
+
1269
+ expect(envelope.status[:code]).to eq(200)
1270
+ expect(envelope.status[:category]).to eq(:ack)
1271
+ 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"})
1272
+
1273
+ expect(envelope.result[:code]).to eq(200)
1274
+ expect(envelope.result[:operation]).to eq(:audit)
1275
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 136}}}}})
1276
+ end
1277
+ end
537
1278
 
538
- it '__auth_key___key____channel__nil___channel_group__nil___http_sync__true___callback___block_' do
539
- VCR.use_cassette('examples/audit/27', record: :none) do
540
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186860'
541
- Pubnub::Audit.any_instance.stub(:signature).and_return 'u1l9yustVc-pGEn0HlJOhIS92jZZ-t0f5pUxHtnY96c='
542
- envelope = @pubnub.audit(auth_key: 'key', http_sync: true, &@callback)
543
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
544
- expect(envelope.error?).to eq false
1279
+ it "__auth_key__nil___channel__nil___channel_group___demo____http_sync__true___callback___lambda_" do
1280
+ VCR.use_cassette("examples/audit/64", record: :none) do
1281
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464186893"
1282
+ Pubnub::Audit.any_instance.stub(:signature).and_return "xGfzbLCBFZQLiRjO47QkfQ_6wtm_dAtFxWw85moUuGM="
1283
+ envelope = @pubnub.audit(channel_group: "demo", http_sync: true, callback: @callback)
1284
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1285
+ expect(envelope.error?).to eq false
1286
+
1287
+ expect(envelope.status[:code]).to eq(200)
1288
+ expect(envelope.status[:category]).to eq(:ack)
1289
+ 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"})
1290
+
1291
+ expect(envelope.result[:code]).to eq(200)
1292
+ expect(envelope.result[:operation]).to eq(:audit)
1293
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 136}}}}})
1294
+ end
1295
+ end
545
1296
 
546
- expect(envelope.status[:code]).to eq(200)
547
- expect(envelope.status[:category]).to eq(:ack)
548
- 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"})
1297
+ it "__auth_key__nil___channel__nil___channel_group___demo____http_sync__false___callback__nil_" do
1298
+ VCR.use_cassette("examples/audit/62", record: :none) do
1299
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187190"
1300
+ Pubnub::Audit.any_instance.stub(:signature).and_return "re-CZsBJXIV7q-ySlvmf57h5QoY2yDID6wNztkL4aWs="
1301
+ envelope = @pubnub.audit(channel_group: "demo", http_sync: false)
1302
+ envelope = envelope.value
1303
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1304
+ expect(envelope.error?).to eq false
1305
+
1306
+ expect(envelope.status[:code]).to eq(200)
1307
+ expect(envelope.status[:category]).to eq(:ack)
1308
+ 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"})
1309
+
1310
+ expect(envelope.result[:code]).to eq(200)
1311
+ expect(envelope.result[:operation]).to eq(:audit)
1312
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 131}}}}})
1313
+ end
1314
+ end
549
1315
 
550
- expect(envelope.result[:code]).to eq(200)
551
- expect(envelope.result[:operation]).to eq(:audit)
552
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>0, "ttl"=>287}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1441, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>137}}}}})
1316
+ it "__auth_key__nil___channel__nil___channel_group___demo____http_sync__false___callback___block_" do
1317
+ VCR.use_cassette("examples/audit/60", record: :none) do
1318
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187229"
1319
+ Pubnub::Audit.any_instance.stub(:signature).and_return "EM6BOT3BYNZt7kopcHA-WrncvnSwE4Ghlj75IjZ4gdM="
1320
+ envelope = @pubnub.audit(channel_group: "demo", http_sync: false, &@callback)
1321
+ envelope = envelope.value
1322
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1323
+ expect(envelope.error?).to eq false
1324
+
1325
+ expect(envelope.status[:code]).to eq(200)
1326
+ expect(envelope.status[:category]).to eq(:ack)
1327
+ 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"})
1328
+
1329
+ expect(envelope.result[:code]).to eq(200)
1330
+ expect(envelope.result[:operation]).to eq(:audit)
1331
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 130}}}}})
1332
+ end
1333
+ end
553
1334
 
1335
+ it "__auth_key__nil___channel__nil___channel_group___demo____http_sync__false___callback___lambda_" do
1336
+ VCR.use_cassette("examples/audit/61", record: :none) do
1337
+ Pubnub::Audit.any_instance.stub(:current_time).and_return "1464187230"
1338
+ Pubnub::Audit.any_instance.stub(:signature).and_return "Eesqu6eJcmypG3KGURLJO8Qd_Z0ZsmyH9YJPCDaOeak="
1339
+ envelope = @pubnub.audit(channel_group: "demo", http_sync: false, callback: @callback)
1340
+ envelope = envelope.value
1341
+ expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1342
+ expect(envelope.error?).to eq false
1343
+
1344
+ expect(envelope.status[:code]).to eq(200)
1345
+ expect(envelope.status[:category]).to eq(:ack)
1346
+ 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"})
1347
+
1348
+ expect(envelope.result[:code]).to eq(200)
1349
+ expect(envelope.result[:operation]).to eq(:audit)
1350
+ expect(envelope.result[:data]).to eq({"level" => "channel-group", "subscribe_key" => "sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups" => {"demo" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 1440, "auths" => {"ruby-authkey" => {"r" => 1, "m" => 1, "w" => 1, "ttl" => 130}}}}})
1351
+ end
1352
+ end
554
1353
  end
555
- end
556
-
557
-
558
- it '__auth_key___key____channel__nil___channel_group__nil___http_sync__true___callback___lambda_' do
559
- VCR.use_cassette('examples/audit/28', record: :none) do
560
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186862'
561
- Pubnub::Audit.any_instance.stub(:signature).and_return 'rDnYUUgtiji8KV5x3aynVC6UtxyamTvA_A8vyoVgxP8='
562
- envelope = @pubnub.audit(auth_key: 'key', http_sync: true, callback: @callback)
563
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
564
- expect(envelope.error?).to eq false
565
-
566
- expect(envelope.status[:code]).to eq(200)
567
- expect(envelope.status[:category]).to eq(:ack)
568
- 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"})
569
-
570
- expect(envelope.result[:code]).to eq(200)
571
- expect(envelope.result[:operation]).to eq(:audit)
572
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>0, "ttl"=>287}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>137}}}}})
573
-
574
- end
575
- end
576
-
577
-
578
- it '__auth_key___key____channel__nil___channel_group__nil___http_sync__false___callback__nil_' do
579
- VCR.use_cassette('examples/audit/26', record: :none) do
580
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187180'
581
- Pubnub::Audit.any_instance.stub(:signature).and_return '9wkrJlRhyUBRqSlFvTbNTWn-xKLvzL11IzhCnf0oqec='
582
- envelope = @pubnub.audit(auth_key: 'key', http_sync: false)
583
- envelope = envelope.value
584
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
585
- expect(envelope.error?).to eq false
586
-
587
- expect(envelope.status[:code]).to eq(200)
588
- expect(envelope.status[:category]).to eq(:ack)
589
- 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"})
590
-
591
- expect(envelope.result[:code]).to eq(200)
592
- expect(envelope.result[:operation]).to eq(:audit)
593
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>4}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>4}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>131}}}}})
594
-
595
- end
596
- end
597
-
598
-
599
- it '__auth_key___key____channel__nil___channel_group__nil___http_sync__false___callback___block_' do
600
- VCR.use_cassette('examples/audit/24', record: :none) do
601
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187181'
602
- Pubnub::Audit.any_instance.stub(:signature).and_return 'tsn5u0yycPJCZYK-vkbQ2oF18TtXsSlJYufJkjo8TWA='
603
- envelope = @pubnub.audit(auth_key: 'key', http_sync: false, &@callback)
604
- envelope = envelope.value
605
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
606
- expect(envelope.error?).to eq false
607
-
608
- expect(envelope.status[:code]).to eq(200)
609
- expect(envelope.status[:category]).to eq(:ack)
610
- 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"})
611
-
612
- expect(envelope.result[:code]).to eq(200)
613
- expect(envelope.result[:operation]).to eq(:audit)
614
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>4}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>4}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>131}}}}})
615
-
616
- end
617
- end
618
-
619
-
620
- it '__auth_key___key____channel__nil___channel_group__nil___http_sync__false___callback___lambda_' do
621
- VCR.use_cassette('examples/audit/25', record: :none) do
622
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186863'
623
- Pubnub::Audit.any_instance.stub(:signature).and_return '9RN6L5X-Nu3T12G5ZWloZCk3c0CEr0SvnSmR7R5WdGE='
624
- envelope = @pubnub.audit(auth_key: 'key', http_sync: false, callback: @callback)
625
- envelope = envelope.value
626
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
627
- expect(envelope.error?).to eq false
628
-
629
- expect(envelope.status[:code]).to eq(200)
630
- expect(envelope.status[:category]).to eq(:ack)
631
- 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"})
632
-
633
- expect(envelope.result[:code]).to eq(200)
634
- expect(envelope.result[:operation]).to eq(:audit)
635
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>0, "ttl"=>287}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>137}}}}})
636
-
637
- end
638
- end
639
-
640
-
641
- it '__auth_key___key___channel___demo___channel_group__nil___http_sync__true___callback__nil_' do
642
- VCR.use_cassette('examples/audit/41', record: :none) do
643
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464697015'
644
- Pubnub::Audit.any_instance.stub(:signature).and_return '5ZfjOxWir6bGaGkEP4eUH-767wTFN_ssDaoWep4Hkb0='
645
- envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: true)
646
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
647
- expect(envelope.error?).to eq false
648
-
649
- expect(envelope.status[:code]).to eq(200)
650
- expect(envelope.status[:category]).to eq(:ack)
651
- 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"})
652
-
653
- expect(envelope.result[:code]).to eq(200)
654
- expect(envelope.result[:operation]).to eq(:audit)
655
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
656
-
657
- end
658
- end
659
-
660
-
661
- it '__auth_key___key___channel___demo___channel_group__nil___http_sync__true___callback___block_' do
662
- VCR.use_cassette('examples/audit/39', record: :none) do
663
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186866'
664
- Pubnub::Audit.any_instance.stub(:signature).and_return 'usnDxndAATqV1coJa4gi98wXpZqZeABZfVnaB8Wj1qw='
665
- envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: true, &@callback)
666
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
667
- expect(envelope.error?).to eq false
668
-
669
- expect(envelope.status[:code]).to eq(200)
670
- expect(envelope.status[:category]).to eq(:ack)
671
- 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"})
672
-
673
- expect(envelope.result[:code]).to eq(200)
674
- expect(envelope.result[:operation]).to eq(:audit)
675
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
676
-
677
- end
678
- end
679
-
680
-
681
- it '__auth_key___key___channel___demo___channel_group__nil___http_sync__true___callback___lambda_' do
682
- VCR.use_cassette('examples/audit/40', record: :none) do
683
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186867'
684
- Pubnub::Audit.any_instance.stub(:signature).and_return 'ABUVcFuZjtM-cwXrzr75SnERRqEaVkvc-W0WoB4tWTQ='
685
- envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: true, callback: @callback)
686
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
687
- expect(envelope.error?).to eq false
688
-
689
- expect(envelope.status[:code]).to eq(200)
690
- expect(envelope.status[:category]).to eq(:ack)
691
- 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"})
692
-
693
- expect(envelope.result[:code]).to eq(200)
694
- expect(envelope.result[:operation]).to eq(:audit)
695
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
696
-
697
- end
698
- end
699
-
700
-
701
- it '__auth_key___key___channel___demo___channel_group__nil___http_sync__false___callback__nil_' do
702
- VCR.use_cassette('examples/audit/38', record: :none) do
703
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464697103'
704
- Pubnub::Audit.any_instance.stub(:signature).and_return 'BE23sz5fM0NFfOnj5tY517l-kDbUt9k-gHToxlZ31oc='
705
- envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: false)
706
- envelope = envelope.value
707
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
708
- expect(envelope.error?).to eq false
709
-
710
- expect(envelope.status[:code]).to eq(200)
711
- expect(envelope.status[:category]).to eq(:ack)
712
- 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"})
713
-
714
- expect(envelope.result[:code]).to eq(200)
715
- expect(envelope.result[:operation]).to eq(:audit)
716
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
717
-
718
- end
719
- end
720
-
721
-
722
- it '__auth_key___key___channel___demo___channel_group__nil___http_sync__false___callback___block_' do
723
- VCR.use_cassette('examples/audit/36', record: :none) do
724
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187183'
725
- Pubnub::Audit.any_instance.stub(:signature).and_return 'cDNc_FY2QVP6yEC_G0IILwDxYKppEmHsWTV3HN8nas8='
726
- envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: false, &@callback)
727
- envelope = envelope.value
728
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
729
- expect(envelope.error?).to eq false
730
-
731
- expect(envelope.status[:code]).to eq(200)
732
- expect(envelope.status[:category]).to eq(:ack)
733
- 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"})
734
-
735
- expect(envelope.result[:code]).to eq(200)
736
- expect(envelope.result[:operation]).to eq(:audit)
737
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
738
-
739
- end
740
- end
741
-
742
-
743
- it '__auth_key___key___channel___demo___channel_group__nil___http_sync__false___callback___lambda_' do
744
- VCR.use_cassette('examples/audit/37', record: :none) do
745
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187029'
746
- Pubnub::Audit.any_instance.stub(:signature).and_return 'owH-615JpjXjMH9BE-wqxSwHQb2iNT7GZAfuiNDV13A='
747
- envelope = @pubnub.audit(auth_key: :key, channel: :demo, http_sync: false, callback: @callback)
748
- envelope = envelope.value
749
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
750
- expect(envelope.error?).to eq false
751
-
752
- expect(envelope.status[:code]).to eq(200)
753
- expect(envelope.status[:category]).to eq(:ack)
754
- 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"})
755
-
756
- expect(envelope.result[:code]).to eq(200)
757
- expect(envelope.result[:operation]).to eq(:audit)
758
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
759
-
760
- end
761
- end
762
-
763
-
764
- it '__auth_key___key___channel___demo____channel_group__nil___http_sync__true___callback__nil_' do
765
- VCR.use_cassette('examples/audit/35', record: :none) do
766
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186868'
767
- Pubnub::Audit.any_instance.stub(:signature).and_return 'xsUvKRUuuN2uvZxPusRjwUoR8A_aAlGrVad6mwTVWBg='
768
- envelope = @pubnub.audit(auth_key: :key, channel: 'demo', http_sync: true)
769
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
770
- expect(envelope.error?).to eq false
771
-
772
- expect(envelope.status[:code]).to eq(200)
773
- expect(envelope.status[:category]).to eq(:ack)
774
- 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"})
775
-
776
- expect(envelope.result[:code]).to eq(200)
777
- expect(envelope.result[:operation]).to eq(:audit)
778
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
779
-
780
- end
781
- end
782
-
783
-
784
- it '__auth_key___key___channel___demo____channel_group__nil___http_sync__true___callback___block_' do
785
- VCR.use_cassette('examples/audit/33', record: :none) do
786
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186870'
787
- Pubnub::Audit.any_instance.stub(:signature).and_return 'pHjJryzjA3ZV9KbsGXRPfj97hAxptOGFiwO-Mr8Rq6Y='
788
- envelope = @pubnub.audit(auth_key: :key, channel: 'demo', http_sync: true, &@callback)
789
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
790
- expect(envelope.error?).to eq false
791
-
792
- expect(envelope.status[:code]).to eq(200)
793
- expect(envelope.status[:category]).to eq(:ack)
794
- 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"})
795
-
796
- expect(envelope.result[:code]).to eq(200)
797
- expect(envelope.result[:operation]).to eq(:audit)
798
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
799
-
800
- end
801
- end
802
-
803
-
804
- it '__auth_key___key___channel___demo____channel_group__nil___http_sync__true___callback___lambda_' do
805
- VCR.use_cassette('examples/audit/34', record: :none) do
806
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186870'
807
- Pubnub::Audit.any_instance.stub(:signature).and_return 'pHjJryzjA3ZV9KbsGXRPfj97hAxptOGFiwO-Mr8Rq6Y='
808
- envelope = @pubnub.audit(auth_key: :key, channel: 'demo', http_sync: true, callback: @callback)
809
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
810
- expect(envelope.error?).to eq false
811
-
812
- expect(envelope.status[:code]).to eq(200)
813
- expect(envelope.status[:category]).to eq(:ack)
814
- 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"})
815
-
816
- expect(envelope.result[:code]).to eq(200)
817
- expect(envelope.result[:operation]).to eq(:audit)
818
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
819
-
820
- end
821
- end
822
-
823
-
824
- it '__auth_key___key___channel___demo____channel_group__nil___http_sync__false___callback__nil_' do
825
- VCR.use_cassette('examples/audit/32', record: :none) do
826
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186871'
827
- Pubnub::Audit.any_instance.stub(:signature).and_return 'B0RNLxxNNLm7iRCUv9mSQLg1YUORR35yFQsm86tNfWw='
828
- envelope = @pubnub.audit(auth_key: :key, channel: 'demo', http_sync: false)
829
- envelope = envelope.value
830
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
831
- expect(envelope.error?).to eq false
832
-
833
- expect(envelope.status[:code]).to eq(200)
834
- expect(envelope.status[:category]).to eq(:ack)
835
- 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"})
836
-
837
- expect(envelope.result[:code]).to eq(200)
838
- expect(envelope.result[:operation]).to eq(:audit)
839
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
840
-
841
- end
842
- end
843
-
844
-
845
- it '__auth_key___key___channel___demo____channel_group__nil___http_sync__false___callback___block_' do
846
- VCR.use_cassette('examples/audit/30', record: :none) do
847
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186872'
848
- Pubnub::Audit.any_instance.stub(:signature).and_return '-h7c12J12qAHVvyFZExhv8DXo_C6ZOCz6Q-MwMvxrrE='
849
- envelope = @pubnub.audit(auth_key: :key, channel: 'demo', http_sync: false, &@callback)
850
- envelope = envelope.value
851
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
852
- expect(envelope.error?).to eq false
853
-
854
- expect(envelope.status[:code]).to eq(200)
855
- expect(envelope.status[:category]).to eq(:ack)
856
- 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"})
857
-
858
- expect(envelope.result[:code]).to eq(200)
859
- expect(envelope.result[:operation]).to eq(:audit)
860
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
861
-
862
- end
863
- end
864
-
865
-
866
- it '__auth_key___key___channel___demo____channel_group__nil___http_sync__false___callback___lambda_' do
867
- VCR.use_cassette('examples/audit/31', record: :none) do
868
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187184'
869
- Pubnub::Audit.any_instance.stub(:signature).and_return 'NNkSqfTwlGTTYyZwz6ZkM8a92ZvDAaFRbwDwQAe-L2Q='
870
- envelope = @pubnub.audit(auth_key: :key, channel: 'demo', http_sync: false, callback: @callback)
871
- envelope = envelope.value
872
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
873
- expect(envelope.error?).to eq false
874
-
875
- expect(envelope.status[:code]).to eq(200)
876
- expect(envelope.status[:category]).to eq(:ack)
877
- 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"})
878
-
879
- expect(envelope.result[:code]).to eq(200)
880
- expect(envelope.result[:operation]).to eq(:audit)
881
- expect(envelope.result[:data]).to eq({"level"=>"user", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel"=>"demo", "auths"=>{}})
882
-
883
- end
884
- end
885
-
886
-
887
- it '__auth_key___key___channel__nil___channel_group___demo___http_sync__true___callback__nil_' do
888
- VCR.use_cassette('examples/audit/53', record: :none) do
889
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186873'
890
- Pubnub::Audit.any_instance.stub(:signature).and_return 'Lb6Q2aZk5IB2Lrkwo25GtV1d34JHMG136w7tWf295rA='
891
- envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: true)
892
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
893
- expect(envelope.error?).to eq false
894
-
895
- expect(envelope.status[:code]).to eq(200)
896
- expect(envelope.status[:category]).to eq(:ack)
897
- 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"})
898
-
899
- expect(envelope.result[:code]).to eq(200)
900
- expect(envelope.result[:operation]).to eq(:audit)
901
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
902
-
903
- end
904
- end
905
-
906
-
907
- it '__auth_key___key___channel__nil___channel_group___demo___http_sync__true___callback___block_' do
908
- VCR.use_cassette('examples/audit/51', record: :none) do
909
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186873'
910
- Pubnub::Audit.any_instance.stub(:signature).and_return 'Lb6Q2aZk5IB2Lrkwo25GtV1d34JHMG136w7tWf295rA='
911
- envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: true, &@callback)
912
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
913
- expect(envelope.error?).to eq false
914
-
915
- expect(envelope.status[:code]).to eq(200)
916
- expect(envelope.status[:category]).to eq(:ack)
917
- 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"})
918
-
919
- expect(envelope.result[:code]).to eq(200)
920
- expect(envelope.result[:operation]).to eq(:audit)
921
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
922
-
923
- end
924
- end
925
-
926
-
927
- it '__auth_key___key___channel__nil___channel_group___demo___http_sync__true___callback___lambda_' do
928
- VCR.use_cassette('examples/audit/52', record: :none) do
929
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186874'
930
- Pubnub::Audit.any_instance.stub(:signature).and_return 'PM7ONrJcAeIVvVMW4t8rPTu-eCCqwHNL4NX8J4rHyh8='
931
- envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: true, callback: @callback)
932
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
933
- expect(envelope.error?).to eq false
934
-
935
- expect(envelope.status[:code]).to eq(200)
936
- expect(envelope.status[:category]).to eq(:ack)
937
- 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"})
938
-
939
- expect(envelope.result[:code]).to eq(200)
940
- expect(envelope.result[:operation]).to eq(:audit)
941
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
942
-
943
- end
944
- end
945
-
946
-
947
- it '__auth_key___key___channel__nil___channel_group___demo___http_sync__false___callback__nil_' do
948
- VCR.use_cassette('examples/audit/50', record: :none) do
949
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186875'
950
- Pubnub::Audit.any_instance.stub(:signature).and_return '8Liys-fFEhn5tIacHdq2AweRaTfgqaCLWd3i04WjEgs='
951
- envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: false)
952
- envelope = envelope.value
953
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
954
- expect(envelope.error?).to eq false
955
-
956
- expect(envelope.status[:code]).to eq(200)
957
- expect(envelope.status[:category]).to eq(:ack)
958
- 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"})
959
-
960
- expect(envelope.result[:code]).to eq(200)
961
- expect(envelope.result[:operation]).to eq(:audit)
962
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
963
-
964
- end
965
- end
966
-
967
-
968
- it '__auth_key___key___channel__nil___channel_group___demo___http_sync__false___callback___block_' do
969
- VCR.use_cassette('examples/audit/48', record: :none) do
970
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186875'
971
- Pubnub::Audit.any_instance.stub(:signature).and_return '8Liys-fFEhn5tIacHdq2AweRaTfgqaCLWd3i04WjEgs='
972
- envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: false, &@callback)
973
- envelope = envelope.value
974
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
975
- expect(envelope.error?).to eq false
976
-
977
- expect(envelope.status[:code]).to eq(200)
978
- expect(envelope.status[:category]).to eq(:ack)
979
- 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"})
980
-
981
- expect(envelope.result[:code]).to eq(200)
982
- expect(envelope.result[:operation]).to eq(:audit)
983
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
984
-
985
- end
986
- end
987
-
988
-
989
- it '__auth_key___key___channel__nil___channel_group___demo___http_sync__false___callback___lambda_' do
990
- VCR.use_cassette('examples/audit/49', record: :none) do
991
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186876'
992
- Pubnub::Audit.any_instance.stub(:signature).and_return 'Z8ak07OMYU0nwKFi-i2AgeIGT0zMTmMgH6XChQM8En4='
993
- envelope = @pubnub.audit(auth_key: :key, channel_group: :demo, http_sync: false, callback: @callback)
994
- envelope = envelope.value
995
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
996
- expect(envelope.error?).to eq false
997
-
998
- expect(envelope.status[:code]).to eq(200)
999
- expect(envelope.status[:category]).to eq(:ack)
1000
- 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"})
1001
-
1002
- expect(envelope.result[:code]).to eq(200)
1003
- expect(envelope.result[:operation]).to eq(:audit)
1004
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
1005
-
1006
- end
1007
- end
1008
-
1009
-
1010
- it '__auth_key___key___channel__nil___channel_group___demo____http_sync__true___callback__nil_' do
1011
- VCR.use_cassette('examples/audit/47', record: :none) do
1012
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186876'
1013
- Pubnub::Audit.any_instance.stub(:signature).and_return 'Z8ak07OMYU0nwKFi-i2AgeIGT0zMTmMgH6XChQM8En4='
1014
- envelope = @pubnub.audit(auth_key: :key, channel_group: 'demo', http_sync: true)
1015
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1016
- expect(envelope.error?).to eq false
1017
-
1018
- expect(envelope.status[:code]).to eq(200)
1019
- expect(envelope.status[:category]).to eq(:ack)
1020
- 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"})
1021
-
1022
- expect(envelope.result[:code]).to eq(200)
1023
- expect(envelope.result[:operation]).to eq(:audit)
1024
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
1025
-
1026
- end
1027
- end
1028
-
1029
-
1030
- it '__auth_key___key___channel__nil___channel_group___demo____http_sync__true___callback___block_' do
1031
- VCR.use_cassette('examples/audit/45', record: :none) do
1032
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186877'
1033
- Pubnub::Audit.any_instance.stub(:signature).and_return 'I86HpxwUA17o4B9wJDUMYByE_Pl02-3zSV2zvCl57Ms='
1034
- envelope = @pubnub.audit(auth_key: :key, channel_group: 'demo', http_sync: true, &@callback)
1035
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1036
- expect(envelope.error?).to eq false
1037
-
1038
- expect(envelope.status[:code]).to eq(200)
1039
- expect(envelope.status[:category]).to eq(:ack)
1040
- 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"})
1041
-
1042
- expect(envelope.result[:code]).to eq(200)
1043
- expect(envelope.result[:operation]).to eq(:audit)
1044
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
1045
-
1046
- end
1047
- end
1048
-
1049
-
1050
- it '__auth_key___key___channel__nil___channel_group___demo____http_sync__true___callback___lambda_' do
1051
- VCR.use_cassette('examples/audit/46', record: :none) do
1052
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186878'
1053
- Pubnub::Audit.any_instance.stub(:signature).and_return '1DbUmg1E5EtNd_ngB11_3sxl-Z7vEZdvhyiCGmrdvys='
1054
- envelope = @pubnub.audit(auth_key: :key, channel_group: 'demo', http_sync: true, callback: @callback)
1055
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1056
- expect(envelope.error?).to eq false
1057
-
1058
- expect(envelope.status[:code]).to eq(200)
1059
- expect(envelope.status[:category]).to eq(:ack)
1060
- 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"})
1061
-
1062
- expect(envelope.result[:code]).to eq(200)
1063
- expect(envelope.result[:operation]).to eq(:audit)
1064
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
1065
-
1066
- end
1067
- end
1068
-
1069
-
1070
- it '__auth_key___key___channel__nil___channel_group___demo____http_sync__false___callback__nil_' do
1071
- VCR.use_cassette('examples/audit/44', record: :none) do
1072
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187185'
1073
- Pubnub::Audit.any_instance.stub(:signature).and_return 'pflH9F0DGUisemPrvn7_hkBpcQsf0ccHQJBZvzkPpio='
1074
- envelope = @pubnub.audit(auth_key: :key, channel_group: 'demo', http_sync: false)
1075
- envelope = envelope.value
1076
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1077
- expect(envelope.error?).to eq false
1078
-
1079
- expect(envelope.status[:code]).to eq(200)
1080
- expect(envelope.status[:category]).to eq(:ack)
1081
- 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"})
1082
-
1083
- expect(envelope.result[:code]).to eq(200)
1084
- expect(envelope.result[:operation]).to eq(:audit)
1085
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
1086
-
1087
- end
1088
- end
1089
-
1090
-
1091
- it '__auth_key___key___channel__nil___channel_group___demo____http_sync__false___callback___block_' do
1092
- VCR.use_cassette('examples/audit/42', record: :none) do
1093
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187030'
1094
- Pubnub::Audit.any_instance.stub(:signature).and_return 'cn9x4223RiNmk54DsBZ5Nym6b--AUOTcT4fwM9dJ2jw='
1095
- envelope = @pubnub.audit(auth_key: :key, channel_group: 'demo', http_sync: false, &@callback)
1096
- envelope = envelope.value
1097
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1098
- expect(envelope.error?).to eq false
1099
-
1100
- expect(envelope.status[:code]).to eq(200)
1101
- expect(envelope.status[:category]).to eq(:ack)
1102
- 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"})
1103
-
1104
- expect(envelope.result[:code]).to eq(200)
1105
- expect(envelope.result[:operation]).to eq(:audit)
1106
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
1107
-
1108
- end
1109
- end
1110
-
1111
-
1112
- it '__auth_key___key___channel__nil___channel_group___demo____http_sync__false___callback___lambda_' do
1113
- VCR.use_cassette('examples/audit/43', record: :none) do
1114
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187187'
1115
- Pubnub::Audit.any_instance.stub(:signature).and_return 'z9WKikWdsOotjTwmqs5lf1YLz1j1f8Q_A06BN1zriPo='
1116
- envelope = @pubnub.audit(auth_key: :key, channel_group: 'demo', http_sync: false, callback: @callback)
1117
- envelope = envelope.value
1118
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1119
- expect(envelope.error?).to eq false
1120
-
1121
- expect(envelope.status[:code]).to eq(200)
1122
- expect(envelope.status[:category]).to eq(:ack)
1123
- 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"})
1124
-
1125
- expect(envelope.result[:code]).to eq(200)
1126
- expect(envelope.result[:operation]).to eq(:audit)
1127
- expect(envelope.result[:data]).to eq({"level"=>"channel-group+auth", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-group"=>"demo", "auths"=>{}})
1128
-
1129
- end
1130
- end
1131
-
1132
-
1133
- it '__auth_key___key___channel__nil___channel_group__nil___http_sync__true___callback__nil_' do
1134
- VCR.use_cassette('examples/audit/59', record: :none) do
1135
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186880'
1136
- Pubnub::Audit.any_instance.stub(:signature).and_return 'o6qOMJqHZ8kwc6QFD3ZCQY1w1CqRfnHAGaR3-tnAFf0='
1137
- envelope = @pubnub.audit(auth_key: :key, http_sync: true)
1138
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1139
- expect(envelope.error?).to eq false
1140
-
1141
- expect(envelope.status[:code]).to eq(200)
1142
- expect(envelope.status[:category]).to eq(:ack)
1143
- 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"})
1144
-
1145
- expect(envelope.result[:code]).to eq(200)
1146
- expect(envelope.result[:operation]).to eq(:audit)
1147
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>0, "ttl"=>286}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1441, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>136}}}}})
1148
-
1149
- end
1150
- end
1151
-
1152
-
1153
- it '__auth_key___key___channel__nil___channel_group__nil___http_sync__true___callback___block_' do
1154
- VCR.use_cassette('examples/audit/57', record: :none) do
1155
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186882'
1156
- Pubnub::Audit.any_instance.stub(:signature).and_return 'lkXa7M-JXUXCvodcGfKRiUlYf8fg0hfVwngEGK6zN9g='
1157
- envelope = @pubnub.audit(auth_key: :key, http_sync: true, &@callback)
1158
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1159
- expect(envelope.error?).to eq false
1160
-
1161
- expect(envelope.status[:code]).to eq(200)
1162
- expect(envelope.status[:category]).to eq(:ack)
1163
- 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"})
1164
-
1165
- expect(envelope.result[:code]).to eq(200)
1166
- expect(envelope.result[:operation]).to eq(:audit)
1167
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>0, "ttl"=>286}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>136}}}}})
1168
-
1169
- end
1170
- end
1171
-
1172
-
1173
- it '__auth_key___key___channel__nil___channel_group__nil___http_sync__true___callback___lambda_' do
1174
- VCR.use_cassette('examples/audit/58', record: :none) do
1175
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186885'
1176
- Pubnub::Audit.any_instance.stub(:signature).and_return 'pZjPZucMs0WP_2awPTm8_ms-_Pc2OF_lwrgfvHAF0dw='
1177
- envelope = @pubnub.audit(auth_key: :key, http_sync: true, callback: @callback)
1178
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1179
- expect(envelope.error?).to eq false
1180
-
1181
- expect(envelope.status[:code]).to eq(200)
1182
- expect(envelope.status[:category]).to eq(:ack)
1183
- 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"})
1184
-
1185
- expect(envelope.result[:code]).to eq(200)
1186
- expect(envelope.result[:operation]).to eq(:audit)
1187
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>0, "ttl"=>286}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>9}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>136}}}}})
1188
-
1189
- end
1190
- end
1191
-
1192
-
1193
- it '__auth_key___key___channel__nil___channel_group__nil___http_sync__false___callback__nil_' do
1194
- VCR.use_cassette('examples/audit/56', record: :none) do
1195
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187188'
1196
- Pubnub::Audit.any_instance.stub(:signature).and_return 'qNi51Jq8iMdZzM5sPRlfzmovZTvXx3YqSl2s2NwnXwE='
1197
- envelope = @pubnub.audit(auth_key: :key, http_sync: false)
1198
- envelope = envelope.value
1199
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1200
- expect(envelope.error?).to eq false
1201
-
1202
- expect(envelope.status[:code]).to eq(200)
1203
- expect(envelope.status[:category]).to eq(:ack)
1204
- 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"})
1205
-
1206
- expect(envelope.result[:code]).to eq(200)
1207
- expect(envelope.result[:operation]).to eq(:audit)
1208
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>4}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>4}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>131}}}}})
1209
-
1210
- end
1211
- end
1212
-
1213
-
1214
- it '__auth_key___key___channel__nil___channel_group__nil___http_sync__false___callback___block_' do
1215
- VCR.use_cassette('examples/audit/54', record: :none) do
1216
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187031'
1217
- Pubnub::Audit.any_instance.stub(:signature).and_return '7v-HexlXeKhnJ2BajRS2p97U4d6FFGtMakx1JrTMV3M='
1218
- envelope = @pubnub.audit(auth_key: :key, http_sync: false, &@callback)
1219
- envelope = envelope.value
1220
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1221
- expect(envelope.error?).to eq false
1222
-
1223
- expect(envelope.status[:code]).to eq(200)
1224
- expect(envelope.status[:category]).to eq(:ack)
1225
- 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"})
1226
-
1227
- expect(envelope.result[:code]).to eq(200)
1228
- expect(envelope.result[:operation]).to eq(:audit)
1229
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>6}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>6}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>134}}}}})
1230
-
1231
- end
1232
- end
1233
-
1234
-
1235
- it '__auth_key___key___channel__nil___channel_group__nil___http_sync__false___callback___lambda_' do
1236
- VCR.use_cassette('examples/audit/55', record: :none) do
1237
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187189'
1238
- Pubnub::Audit.any_instance.stub(:signature).and_return 'KegVli9MqXXPj3L-awtHyK-ekzfDXGw4k-3esnltka0='
1239
- envelope = @pubnub.audit(auth_key: :key, http_sync: false, callback: @callback)
1240
- envelope = envelope.value
1241
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1242
- expect(envelope.error?).to eq false
1243
-
1244
- expect(envelope.status[:code]).to eq(200)
1245
- expect(envelope.status[:category]).to eq(:ack)
1246
- 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"})
1247
-
1248
- expect(envelope.result[:code]).to eq(200)
1249
- expect(envelope.result[:operation]).to eq(:audit)
1250
- expect(envelope.result[:data]).to eq({"level"=>"subkey", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channels"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}, "ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>4}}}, "demo-pnpres"=>{"r"=>1, "m"=>1, "w"=>1, "auths"=>{"ADMIN-hb89skz71v"=>{"r"=>1, "m"=>0, "w"=>1, "ttl"=>4}}}, "demo.*"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}, "objects"=>{}, "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>131}}}}})
1251
-
1252
- end
1253
- end
1254
-
1255
-
1256
- it '__auth_key__nil___channel__nil___channel_group___demo___http_sync__true___callback__nil_' do
1257
- VCR.use_cassette('examples/audit/71', record: :none) do
1258
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464697104'
1259
- Pubnub::Audit.any_instance.stub(:signature).and_return 'EQJKSlERla2RqqCa8ieN1-5yZcskBULnIz6YUqKSq8Q='
1260
- envelope = @pubnub.audit(channel_group: :demo, http_sync: true)
1261
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1262
- expect(envelope.error?).to eq false
1263
-
1264
- expect(envelope.status[:code]).to eq(200)
1265
- expect(envelope.status[:category]).to eq(:ack)
1266
- 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"})
1267
-
1268
- expect(envelope.result[:code]).to eq(200)
1269
- expect(envelope.result[:operation]).to eq(:audit)
1270
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1439}}})
1271
-
1272
- end
1273
- end
1274
-
1275
-
1276
- it '__auth_key__nil___channel__nil___channel_group___demo___http_sync__true___callback___block_' do
1277
- VCR.use_cassette('examples/audit/69', record: :none) do
1278
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464697105'
1279
- Pubnub::Audit.any_instance.stub(:signature).and_return 'WCmluR0sUF-xGs8gksI2ZQU6w5VxZ55BhK3bo8jV1Bk='
1280
- envelope = @pubnub.audit(channel_group: :demo, http_sync: true, &@callback)
1281
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1282
- expect(envelope.error?).to eq false
1283
-
1284
- expect(envelope.status[:code]).to eq(200)
1285
- expect(envelope.status[:category]).to eq(:ack)
1286
- 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"})
1287
-
1288
- expect(envelope.result[:code]).to eq(200)
1289
- expect(envelope.result[:operation]).to eq(:audit)
1290
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440}}})
1291
-
1292
- end
1293
- end
1294
-
1295
-
1296
- it '__auth_key__nil___channel__nil___channel_group___demo___http_sync__true___callback___lambda_' do
1297
- VCR.use_cassette('examples/audit/70', record: :none) do
1298
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186889'
1299
- Pubnub::Audit.any_instance.stub(:signature).and_return '8g09A0BvUXUKgLwPFstHy9A44w4VI6qNW9-NqKafBaU='
1300
- envelope = @pubnub.audit(channel_group: :demo, http_sync: true, callback: @callback)
1301
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1302
- expect(envelope.error?).to eq false
1303
-
1304
- expect(envelope.status[:code]).to eq(200)
1305
- expect(envelope.status[:category]).to eq(:ack)
1306
- 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"})
1307
-
1308
- expect(envelope.result[:code]).to eq(200)
1309
- expect(envelope.result[:operation]).to eq(:audit)
1310
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>136}}}}})
1311
-
1312
- end
1313
- end
1314
-
1315
-
1316
- it '__auth_key__nil___channel__nil___channel_group___demo___http_sync__false___callback__nil_' do
1317
- VCR.use_cassette('examples/audit/68', record: :none) do
1318
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187033'
1319
- Pubnub::Audit.any_instance.stub(:signature).and_return '8eDkK8LRPtT_VnfyU1otEfGmKfi284g0gDS6yytGCQo='
1320
- envelope = @pubnub.audit(channel_group: :demo, http_sync: false)
1321
- envelope = envelope.value
1322
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1323
- expect(envelope.error?).to eq false
1324
-
1325
- expect(envelope.status[:code]).to eq(200)
1326
- expect(envelope.status[:category]).to eq(:ack)
1327
- 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"})
1328
-
1329
- expect(envelope.result[:code]).to eq(200)
1330
- expect(envelope.result[:operation]).to eq(:audit)
1331
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>134}}}}})
1332
-
1333
- end
1334
- end
1335
-
1336
-
1337
- it '__auth_key__nil___channel__nil___channel_group___demo___http_sync__false___callback___block_' do
1338
- VCR.use_cassette('examples/audit/66', record: :none) do
1339
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186890'
1340
- Pubnub::Audit.any_instance.stub(:signature).and_return 'EFlQZ2fQ756aPBryetYFd6EFMEuj1Ke9oCW5BpkFAi4='
1341
- envelope = @pubnub.audit(channel_group: :demo, http_sync: false, &@callback)
1342
- envelope = envelope.value
1343
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1344
- expect(envelope.error?).to eq false
1345
-
1346
- expect(envelope.status[:code]).to eq(200)
1347
- expect(envelope.status[:category]).to eq(:ack)
1348
- 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"})
1349
-
1350
- expect(envelope.result[:code]).to eq(200)
1351
- expect(envelope.result[:operation]).to eq(:audit)
1352
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>136}}}}})
1353
-
1354
- end
1355
- end
1356
-
1357
-
1358
- it '__auth_key__nil___channel__nil___channel_group___demo___http_sync__false___callback___lambda_' do
1359
- VCR.use_cassette('examples/audit/67', record: :none) do
1360
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187033'
1361
- Pubnub::Audit.any_instance.stub(:signature).and_return '8eDkK8LRPtT_VnfyU1otEfGmKfi284g0gDS6yytGCQo='
1362
- envelope = @pubnub.audit(channel_group: :demo, http_sync: false, callback: @callback)
1363
- envelope = envelope.value
1364
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1365
- expect(envelope.error?).to eq false
1366
-
1367
- expect(envelope.status[:code]).to eq(200)
1368
- expect(envelope.status[:category]).to eq(:ack)
1369
- 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"})
1370
-
1371
- expect(envelope.result[:code]).to eq(200)
1372
- expect(envelope.result[:operation]).to eq(:audit)
1373
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>134}}}}})
1374
-
1375
- end
1376
- end
1377
-
1378
-
1379
- it '__auth_key__nil___channel__nil___channel_group___demo____http_sync__true___callback__nil_' do
1380
- VCR.use_cassette('examples/audit/65', record: :none) do
1381
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186891'
1382
- Pubnub::Audit.any_instance.stub(:signature).and_return 'llWHzSYMTpc24K92E6ZhBACHbCOGqS4Dg-Fo94PjpR8='
1383
- envelope = @pubnub.audit(channel_group: 'demo', http_sync: true)
1384
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1385
- expect(envelope.error?).to eq false
1386
-
1387
- expect(envelope.status[:code]).to eq(200)
1388
- expect(envelope.status[:category]).to eq(:ack)
1389
- 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"})
1390
-
1391
- expect(envelope.result[:code]).to eq(200)
1392
- expect(envelope.result[:operation]).to eq(:audit)
1393
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>136}}}}})
1394
-
1395
- end
1396
- end
1397
-
1398
-
1399
- it '__auth_key__nil___channel__nil___channel_group___demo____http_sync__true___callback___block_' do
1400
- VCR.use_cassette('examples/audit/63', record: :none) do
1401
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186892'
1402
- Pubnub::Audit.any_instance.stub(:signature).and_return '0Y4khklcMAg1rSpr4z-G_Hu7EjLWVWwgWJUEbRy7uVc='
1403
- envelope = @pubnub.audit(channel_group: 'demo', http_sync: true, &@callback)
1404
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1405
- expect(envelope.error?).to eq false
1406
-
1407
- expect(envelope.status[:code]).to eq(200)
1408
- expect(envelope.status[:category]).to eq(:ack)
1409
- 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"})
1410
-
1411
- expect(envelope.result[:code]).to eq(200)
1412
- expect(envelope.result[:operation]).to eq(:audit)
1413
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>136}}}}})
1414
-
1415
- end
1416
- end
1417
-
1418
-
1419
- it '__auth_key__nil___channel__nil___channel_group___demo____http_sync__true___callback___lambda_' do
1420
- VCR.use_cassette('examples/audit/64', record: :none) do
1421
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464186893'
1422
- Pubnub::Audit.any_instance.stub(:signature).and_return 'xGfzbLCBFZQLiRjO47QkfQ_6wtm_dAtFxWw85moUuGM='
1423
- envelope = @pubnub.audit(channel_group: 'demo', http_sync: true, callback: @callback)
1424
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1425
- expect(envelope.error?).to eq false
1426
-
1427
- expect(envelope.status[:code]).to eq(200)
1428
- expect(envelope.status[:category]).to eq(:ack)
1429
- 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"})
1430
-
1431
- expect(envelope.result[:code]).to eq(200)
1432
- expect(envelope.result[:operation]).to eq(:audit)
1433
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>136}}}}})
1434
-
1435
- end
1436
- end
1437
-
1438
-
1439
- it '__auth_key__nil___channel__nil___channel_group___demo____http_sync__false___callback__nil_' do
1440
- VCR.use_cassette('examples/audit/62', record: :none) do
1441
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187190'
1442
- Pubnub::Audit.any_instance.stub(:signature).and_return 're-CZsBJXIV7q-ySlvmf57h5QoY2yDID6wNztkL4aWs='
1443
- envelope = @pubnub.audit(channel_group: 'demo', http_sync: false)
1444
- envelope = envelope.value
1445
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1446
- expect(envelope.error?).to eq false
1447
-
1448
- expect(envelope.status[:code]).to eq(200)
1449
- expect(envelope.status[:category]).to eq(:ack)
1450
- 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"})
1451
-
1452
- expect(envelope.result[:code]).to eq(200)
1453
- expect(envelope.result[:operation]).to eq(:audit)
1454
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>131}}}}})
1455
-
1456
- end
1457
- end
1458
-
1459
-
1460
- it '__auth_key__nil___channel__nil___channel_group___demo____http_sync__false___callback___block_' do
1461
- VCR.use_cassette('examples/audit/60', record: :none) do
1462
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187229'
1463
- Pubnub::Audit.any_instance.stub(:signature).and_return 'EM6BOT3BYNZt7kopcHA-WrncvnSwE4Ghlj75IjZ4gdM='
1464
- envelope = @pubnub.audit(channel_group: 'demo', http_sync: false, &@callback)
1465
- envelope = envelope.value
1466
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1467
- expect(envelope.error?).to eq false
1468
-
1469
- expect(envelope.status[:code]).to eq(200)
1470
- expect(envelope.status[:category]).to eq(:ack)
1471
- 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"})
1472
-
1473
- expect(envelope.result[:code]).to eq(200)
1474
- expect(envelope.result[:operation]).to eq(:audit)
1475
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>130}}}}})
1476
-
1477
- end
1478
- end
1479
-
1480
-
1481
- it '__auth_key__nil___channel__nil___channel_group___demo____http_sync__false___callback___lambda_' do
1482
- VCR.use_cassette('examples/audit/61', record: :none) do
1483
- Pubnub::Audit.any_instance.stub(:current_time).and_return '1464187230'
1484
- Pubnub::Audit.any_instance.stub(:signature).and_return 'Eesqu6eJcmypG3KGURLJO8Qd_Z0ZsmyH9YJPCDaOeak='
1485
- envelope = @pubnub.audit(channel_group: 'demo', http_sync: false, callback: @callback)
1486
- envelope = envelope.value
1487
- expect(envelope.is_a?(Pubnub::Envelope)).to eq true
1488
- expect(envelope.error?).to eq false
1489
-
1490
- expect(envelope.status[:code]).to eq(200)
1491
- expect(envelope.status[:category]).to eq(:ack)
1492
- 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"})
1493
-
1494
- expect(envelope.result[:code]).to eq(200)
1495
- expect(envelope.result[:operation]).to eq(:audit)
1496
- expect(envelope.result[:data]).to eq({"level"=>"channel-group", "subscribe_key"=>"sub-c-b7fb805a-1777-11e6-be83-0619f8945a4f", "channel-groups"=>{"demo"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>1440, "auths"=>{"ruby-authkey"=>{"r"=>1, "m"=>1, "w"=>1, "ttl"=>130}}}}})
1497
-
1498
- end
1499
- end
1500
-
1501
-
1502
- end
1503
-