Sha256: 8eae12a762c2ecc949f23e88cb0a595933dfe04debbb3f1d9748feac1b6a84a1

Contents?: true

Size: 465 Bytes

Versions: 2

Compression:

Stored size: 465 Bytes

Contents

require 'spec_helper'

describe Whisperer::Serializers::JsonMultiple do
  describe '#serialize' do
    let(:attrs) {
      {
        first_name: 'John',
        last_name:  'Snow'
      }
    }

    let(:data) {
      [
        OpenStruct.new(attrs)
      ]
    }

    subject { described_class.new(data) }

    it 'returns json string with a serialized array' do
      expect(subject.serialize).to eq('[{"first_name":"John","last_name":"Snow"}]')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whisperer-0.0.2 spec/unit/serializers/json_multiple_spec.rb
whisperer-0.0.1 spec/unit/serializers/json_multiple_spec.rb