Skip to content
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

🧹 Rename generic_work_form_spec to reflect decoration #35

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented Oct 4, 2023

Prior to this commit the Knapsace generic_work_form_spec had a test for terms
that was not part of the Hyku. We introduce these differences through our
decoration in ./app/forms/hyrax/generic_work_form_decorator.rb

To reflect the existence of the decorator and not have a duplicate file
that future us would need to synchronize with Hyku, I've moved the file
and winnowed it down to reflect the specific changes.

I also needed to add three new properties to the spec as it reflects
upstream changes in Hyku (e.g. access_right alternative_title
rights_notes)

Diff of filein Hyku and Knapsack
❯ diff spec/forms/hyrax/generic_work_form_spec.rb hyrax-webapp/spec/forms/hyrax/generic_work_form_spec.rb
26,43d25
<   describe '.terms' do
<     it 'returns an array of inherited and custom terms' do
<       expect(described_class.terms.sort).to eq(
<         %i[
<           title creator contributor description keyword abstract
<           license rights_statement publisher date_created
<           subject language identifier based_near related_url
<           representative_id thumbnail_id rendering_ids files
<           visibility_during_embargo embargo_release_date visibility_after_embargo
<           visibility_during_lease lease_expiration_date visibility_after_lease
<           visibility ordered_member_ids source in_works_ids member_of_collection_ids
<           admin_set_id resource_type aark_id part_of place_of_publication
<           date_issued alt bibliographic_citation remote_url video_embed
<         ].sort
<       )
<     end
<   end
<

Related to:

Prior to this commit the Knapsace generic_work_form_spec had a test for terms
that was not part of the Hyku.  We introduce these differences through our
decoration in ./app/forms/hyrax/generic_work_form_decorator.rb

To reflect the existence of the decorator and not have a duplicate file
that future us would need to synchronize with Hyku, I've moved the file
and winnowed it down to reflect the specific changes.

I also needed to add three new properties to the spec as it reflects
upstream changes in Hyku (e.g. `access_right` `alternative_title`
`rights_notes`)

<details>
<summary>Diff of filein Hyku and Knapsack</summary>

```
❯ diff spec/forms/hyrax/generic_work_form_spec.rb hyrax-webapp/spec/forms/hyrax/generic_work_form_spec.rb
26,43d25
<   describe '.terms' do
<     it 'returns an array of inherited and custom terms' do
<       expect(described_class.terms.sort).to eq(
<         %i[
<           title creator contributor description keyword abstract
<           license rights_statement publisher date_created
<           subject language identifier based_near related_url
<           representative_id thumbnail_id rendering_ids files
<           visibility_during_embargo embargo_release_date visibility_after_embargo
<           visibility_during_lease lease_expiration_date visibility_after_lease
<           visibility ordered_member_ids source in_works_ids member_of_collection_ids
<           admin_set_id resource_type aark_id part_of place_of_publication
<           date_issued alt bibliographic_citation remote_url video_embed
<         ].sort
<       )
<     end
<   end
<
```
</details>

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/538
@jeremyf jeremyf force-pushed the rename-generic_work_form_spec-to-reflect-decoration branch from 89b8e1d to 98d823f Compare October 4, 2023 16:17
@jeremyf jeremyf merged commit 18e2865 into main Oct 4, 2023
1 of 4 checks passed
@jeremyf jeremyf deleted the rename-generic_work_form_spec-to-reflect-decoration branch October 4, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants