Sha256: a652fedc6c102dfae06617cc8f540b5b350a7f1e7188b9395d7809517226b49d

Contents?: true

Size: 887 Bytes

Versions: 23

Compression:

Stored size: 887 Bytes

Contents

require 'unit_spec_helper'

describe Rpush::Client::ActiveRecord::Wns::RawNotification do
  let(:notification) do
    notif = Rpush::Client::ActiveRecord::Wns::RawNotification.new
    notif.app  = Rpush::Client::ActiveRecord::Wns::App.new(name: "aname")
    notif.uri  = 'https://db5.notify.windows.com/?token=TOKEN'
    notif.data = { foo: 'foo', bar: 'bar' }
    notif
  end

  it 'does not allow the size of payload over 5 KB' do
    allow(notification).to receive(:payload_data_size) { 5121 }
    expect(notification.valid?).to be(false)
  end

  it 'allows exact payload of 5 KB' do
    allow(notification).to receive(:payload_data_size) { 5120 }
    expect(notification.valid?).to be(true)
  end

  it 'allows the size of payload under 5 KB' do
    allow(notification).to receive(:payload_data_size) { 5119 }
    expect(notification.valid?).to be(true)
  end
end if active_record?

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
rpush-5.0.0 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-4.2.0 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-4.1.1 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-4.1.0 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-4.0.1 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-4.0.0 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.3.1 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.3.0 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush_extended-3.2.6 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush_extended-3.2.5 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.2.4 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.2.3 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.2.2 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.2.1 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.2.0 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.1.1 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.1.0 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.0.2 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.0.1 spec/unit/client/active_record/wns/raw_notification_spec.rb
rpush-3.0.0 spec/unit/client/active_record/wns/raw_notification_spec.rb