blob: f35684bef204a3aa6af30e5b8fe785f30d225a33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Import::BulkImportEntity do
let(:importable_data) do
{
'id' => 1,
'full_name' => 'test',
'full_path' => 'full/path/test',
'foo' => 'bar'
}
end
subject { described_class.represent(importable_data).as_json }
%w[id full_name full_path].each do |attribute|
it "exposes #{attribute}" do
expect(subject[attribute.to_sym]).to eq(importable_data[attribute])
end
end
it 'does not expose unspecified attributes' do
expect(subject[:foo]).to be_nil
end
end
|