about summary refs log tree commit diff
path: root/spec/serializers/rest/keys/device_serializer_spec.rb
blob: c15e197cb8fb39461d36436f8747742a5f763ea1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

require 'rails_helper'

describe REST::Keys::DeviceSerializer do
  let(:serialization) do
    JSON.parse(
      ActiveModelSerializers::SerializableResource.new(
        record, serializer: described_class
      ).to_json
    )
  end
  let(:record) { Device.new(name: 'Device name') }

  describe 'name' do
    it 'returns the name' do
      expect(serialization['name']).to eq('Device name')
    end
  end
end