Improve spec_helper and rails_helper for Hyku 7 and shared specs#48
Closed
ShanaLMoore wants to merge 5 commits intomainfrom
Closed
Improve spec_helper and rails_helper for Hyku 7 and shared specs#48ShanaLMoore wants to merge 5 commits intomainfrom
ShanaLMoore wants to merge 5 commits intomainfrom
Conversation
- Boot Rails from knapsack rails_helper (after ENV) then require only webapp spec_helper - Set ENV to mirror hyrax-webapp test env; keep HYRAX_FLEXIBLE default false - Use config.fixture_paths (plural); add Hyrax + webapp factory paths - Set Hyrax Valkyrie test config; add DatabaseCleaner, Devise, Warden, ActiveJob includes Made-with: Cursor
ShanaLMoore
commented
Mar 5, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These changes were needed in downstream projects (pals, hyku up)
Summary
This PR updates the knapsack test setup so Rails boots once with ENV set before initializers, and so specs can use Hyrax shared examples and webapp factories. Summary of changes:
rails_helper(after setting ENV), then requires only the webappspec_helper. The webapprails_helperis no longer required, so Rails is not loaded twice and ENV is in place before any initializers run.HYKU_ADMIN_HOST,HYKU_ROOT_HOST,VALKYRIE_TRANSITION,HYRAX_ANALYTICS_REPORTING, etc.).HYRAX_FLEXIBLEkeeps the Hyku default viaENV['HYRAX_FLEXIBLE'] ||= 'false'.config.fixture_paths(plural), the current RSpec/Rails API, instead of the deprecatedconfig.fixture_path.Hyrax.config.admin_set_modelandHyrax.config.collection_modelin test to match hyrax-webapp.Screenshots / Video
N/A (test configuration only).
Expected Behavior
HYRAX_FLEXIBLEstaysfalseunless a spec or .env sets it.Notes
spec_helpernow pulls in only the webappspec_helper(WebMock, rspec-its, Valkyrie adapter, etc.), not the webapprails_helper.