-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make search string used to look up objects configurable #884
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d394861
make search string used to look up objects configurable
orangewolf 45ed439
fix lint require for ci, add example to initializer
orangewolf 2e2fbfe
fix typo
orangewolf 6cc6abc
move object factory specs to all be in one place
orangewolf 91aa7b9
make rubocop happy
orangewolf 8547513
unpin dry-monads. its not a dependency of bulkrax, but previously nee…
orangewolf 1b2b9e9
Merge branch 'expand_monads_dependency' into configurable_search_string
orangewolf 3ddd613
Merge branch 'main' into configurable_search_string
jeremyf 1ac8f49
Merge branch 'main' into configurable_search_string
jeremyf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,5 @@ end | |
|
||
group :lint do | ||
gem 'bixby' | ||
gem 'rubocop-factory_bot', require: false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe Bulkrax::ObjectFactory do | ||
# Why aren't there more tests? In part because so much of the ObjectFactory require that we boot | ||
# up Fedora and SOLR; something that remains non-desirous due to speed. | ||
describe "#transform_attributes" do | ||
context 'default behavior' do | ||
it "does not empty arrays that only have empty values" do | ||
attributes = { empty_array: ["", ""], empty_string: "", filled_array: ["A", "B"], filled_string: "A" } | ||
factory = described_class.new(attributes: attributes, source_identifier_value: 123, work_identifier: "filled_string") | ||
factory.base_permitted_attributes = %i[empty_array empty_string filled_array filled_string] | ||
expect(factory.send(:transform_attributes)).to eq(attributes.stringify_keys) | ||
end | ||
end | ||
|
||
context 'when :transformation_removes_blank_hash_values = true' do | ||
it "empties arrays that only have empty values" do | ||
attributes = { empty_array: ["", ""], empty_string: "", filled_array: ["A", "B"], filled_string: "A" } | ||
factory = described_class.new(attributes: attributes, source_identifier_value: 123, work_identifier: "filled_string") | ||
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)) | ||
.to eq({ empty_array: [], empty_string: nil, filled_array: ["A", "B"], filled_string: "A" }.stringify_keys) | ||
end | ||
end | ||
end | ||
end | ||
# NOTE: do not put any specs here. FactoryBot autoloads every ruby file in spec/factories so even through it better | ||
# mirrors the app/ path, we put the ObjectFactory specs in spec/models/bulkrax/object_factory_spec.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️