lib/submodules/ably-ruby/spec/acceptance/realtime/channel_spec.rb in ably-rest-1.1.0 vs lib/submodules/ably-ruby/spec/acceptance/realtime/channel_spec.rb in ably-rest-1.1.2.rc1
- old
+ new
@@ -277,12 +277,11 @@
let(:auth_options) do
default_options.merge(
key: restricted_api_key,
log_level: :fatal,
use_token_auth: true,
- # TODO: Use wildcard / default when intersection issue resolved, realtime#780
- default_token_params: { capability: { "canpublish:foo" => ["publish"] } }
+ default_token_params: { capability: { "canpublish:foo" => ["*"] } }
)
end
let(:restricted_client) do
auto_close Ably::Realtime::Client.new(auth_options)
end
@@ -1007,13 +1006,10 @@
context 'when name is nil' do
let(:data) { random_str }
it 'publishes the message without a name attribute in the payload' do
published = false
- channel.publish(nil, data) do
- published = true
- end
channel.subscribe do |message|
expect(message.name).to be_nil
channel.history do |page|
expect(page.items.first.name).to be_nil
@@ -1022,21 +1018,22 @@
expect(published).to eql(true)
stop_reactor
end
end
end
+
+ channel.publish(nil, data) do
+ published = true
+ end
end
end
context 'when data is nil' do
let(:name) { random_str }
it 'publishes the message without a data attribute in the payload' do
published = false
- channel.publish(name, nil) do
- published = true
- end
channel.subscribe do |message|
expect(message.data).to be_nil
channel.history do |page|
expect(page.items.first.name).to eql(name)
@@ -1045,10 +1042,14 @@
expect(published).to eql(true)
stop_reactor
end
end
end
+
+ channel.publish(name, nil) do
+ published = true
+ end
end
end
context 'with neither name or data attributes' do
let(:name) { random_str }
@@ -1995,9 +1996,11 @@
end
end
end
context '#resume (#RTL2f)' do
+ let(:client_options) { default_options.merge(log_level: :fatal) }
+
it 'is false when a channel first attaches' do
channel.attach
channel.on(:attached) do |channel_state_change|
expect(channel_state_change.resumed).to be_falsey
stop_reactor