Sha256: 69a36b30397149991a21e9b1c3096badde4db5982d8eef848017960be7b30f22

Contents?: true

Size: 482 Bytes

Versions: 4

Compression:

Stored size: 482 Bytes

Contents

require 'spec_helper'

describe FiveMobilePush::Payload do
  describe '#to_json' do
    subject { Fabricate.build(:payload) }

    it 'includes the message' do
      subject.to_json.should include(subject.message)
    end

    it 'includes meta data' do
      subject.to_json.should include(MultiJson.encode(subject.meta_data))
    end

    it 'excludes meta data if there is none' do
      subject.meta_data = nil
      subject.to_json.should_not include('meta')
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
five_mobile_push-0.4.1 spec/five_mobile_push/payload_spec.rb
five_mobile_push-0.4.0 spec/five_mobile_push/payload_spec.rb
five_mobile_push-0.3.1 spec/five_mobile_push/payload_spec.rb
five_mobile_push-0.3.0 spec/five_mobile_push/payload_spec.rb