Sha256: ee438a55591ac6725eb13a9d64431054cefc0be30f918f9bede1faca89a31080

Contents?: true

Size: 615 Bytes

Versions: 2

Compression:

Stored size: 615 Bytes

Contents

require 'spec_helper'

describe NotifyUser::NotificationSerializer, type: :model do
  let(:resource) { create(:notify_user_notification) }
  let(:serializer) { described_class.new(resource) }
  let(:attributes) {[
    'id',
    'type',
    'message',
    'read',
    'params',
    'created_at',
  ]}

  subject do
    JSON.parse(serializer.to_json)
  end

  describe 'root' do
    it 'has a notifications root' do
      expect(subject['notifications']).not_to be_nil
    end

    it 'has the correct attributes in the root' do
      expect(subject['notifications'].keys).to match_array(attributes)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
notify_user-0.3.2 spec/serializers/notify_user/notification_serializer_spec.rb
notify_user-0.3.1 spec/serializers/notify_user/notification_serializer_spec.rb