spec/unit/models/message_spec.rb in ably-0.8.2 vs spec/unit/models/message_spec.rb in ably-0.8.3

- old
+ new

@@ -10,11 +10,11 @@ subject { Ably::Models::Message } let(:protocol_message_timestamp) { as_since_epoch(Time.now) } let(:protocol_message) { Ably::Models::ProtocolMessage.new(action: 1, timestamp: protocol_message_timestamp) } - it_behaves_like 'a model', with_simple_attributes: %w(name client_id data encoding) do + it_behaves_like 'a model', with_simple_attributes: %w(id name client_id data encoding) do let(:model_args) { [protocol_message: protocol_message] } end context '#timestamp' do let(:model) { subject.new({}, protocol_message: protocol_message) } @@ -145,17 +145,9 @@ context 'with valid data' do let(:model) { subject.new({ name: 'test', clientId: 'joe' }, protocol_message: protocol_message) } it 'converts the attribute back to Java mixedCase notation using string keys' do expect(json_object["clientId"]).to eql('joe') - end - end - - context 'with invalid data' do - let(:model) { subject.new({ clientId: 'joe' }, protocol_message: protocol_message) } - - it 'raises an exception' do - expect { model.to_json }.to raise_error RuntimeError, /cannot generate a valid Hash/ end end context 'with binary data' do let(:data) { MessagePack.pack(random_str(32)) }