Skip to content

Commit

Permalink
🧹 Entry is a required argument when initializing ObjectFactory
Browse files Browse the repository at this point in the history
Fix for broken specs

Co-Authored-By: Kirk Wang <[email protected]>
  • Loading branch information
Shana Moore and kirkkwang committed Jan 31, 2024
1 parent 9ad140f commit 5fc4962
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion spec/factories/bulkrax_object_factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
attributes: {},
source_identifier_value: :source_identifier,
work_identifier: :source,
work_identifier_search_field: 'source_sim'
work_identifier_search_field: 'source_sim',
entry: FactoryBot.build(:bulkrax_entry)
)
end
end
Expand Down
6 changes: 4 additions & 2 deletions spec/models/bulkrax/object_factory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ module Bulkrax
factory = described_class.new(attributes: attributes,
source_identifier_value: 123,
work_identifier: "filled_string",
work_identifier_search_field: 'filled_string_sim')
work_identifier_search_field: 'filled_string_sim',
entry: FactoryBot.build(:bulkrax_entry))
factory.base_permitted_attributes = %i[empty_array empty_string filled_array filled_string]
expect(factory.send(:transform_attributes)).to eq(attributes.stringify_keys)
end
Expand All @@ -34,7 +35,8 @@ module Bulkrax
factory = described_class.new(attributes: attributes,
source_identifier_value: 123,
work_identifier: "filled_string",
work_identifier_search_field: 'filled_string_sim')
work_identifier_search_field: 'filled_string_sim',
entry: FactoryBot.build(:bulkrax_entry))
factory.base_permitted_attributes = %i[empty_array empty_string filled_array filled_string]
factory.transformation_removes_blank_hash_values = true
expect(factory.send(:transform_attributes))
Expand Down

0 comments on commit 5fc4962

Please sign in to comment.