diff options
Diffstat (limited to 'spec/serializers/import/bulk_import_entity_spec.rb')
-rw-r--r-- | spec/serializers/import/bulk_import_entity_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/serializers/import/bulk_import_entity_spec.rb b/spec/serializers/import/bulk_import_entity_spec.rb new file mode 100644 index 00000000000..f35684bef20 --- /dev/null +++ b/spec/serializers/import/bulk_import_entity_spec.rb @@ -0,0 +1,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 |