mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 17:21:38 -05:00
23 lines
555 B
Ruby
23 lines
555 B
Ruby
|
|
# frozen_string_literal: true
|
||
|
|
|
||
|
|
require 'rails_helper'
|
||
|
|
|
||
|
|
RSpec.describe PointSerializer do
|
||
|
|
describe '#call' do
|
||
|
|
subject(:serializer) { described_class.new(point).call }
|
||
|
|
|
||
|
|
let(:point) { create(:point) }
|
||
|
|
let(:expected_json) do
|
||
|
|
point.attributes.except(*PointSerializer::EXCLUDED_ATTRIBUTES)
|
||
|
|
end
|
||
|
|
|
||
|
|
it 'returns JSON' do
|
||
|
|
expect(serializer.to_json).to eq(expected_json.to_json)
|
||
|
|
end
|
||
|
|
|
||
|
|
it 'does not include excluded attributes' do
|
||
|
|
expect(serializer).not_to include(*PointSerializer::EXCLUDED_ATTRIBUTES)
|
||
|
|
end
|
||
|
|
end
|
||
|
|
end
|