spec/unit/rest/channel_spec.rb in ably-1.1.6 vs spec/unit/rest/channel_spec.rb in ably-1.1.7
- old
+ new
@@ -12,10 +12,14 @@
end
let(:channel_name) { 'unique' }
subject { Ably::Rest::Channel.new(client, channel_name) }
+ it 'should return Ably::Rest::Channel::MAX_MESSAGE_SIZE equal 65536 (TO3l8)' do
+ expect(Ably::Rest::Channel::MAX_MESSAGE_SIZE).to eq(65536)
+ end
+
describe '#initializer' do
let(:channel_name) { random_str.encode(encoding) }
context 'as UTF_8 string' do
let(:encoding) { Encoding::UTF_8 }
@@ -122,9 +126,15 @@
context 'as Integer' do
let(:encoded_value) { 1 }
it 'raises an argument error' do
expect { subject.publish(encoded_value, 'data') }.to raise_error ArgumentError, /must be a String/
+ end
+ end
+
+ context 'max message size exceeded' do
+ it 'should raise Ably::Exceptions::MaxMessageSizeExceeded' do
+ expect { subject.publish('x' * 65537, 'data') }.to raise_error Ably::Exceptions::MaxMessageSizeExceeded
end
end
end
end