-
Notifications
You must be signed in to change notification settings - Fork 124
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
Allow work form to display when wings is disabled #5242
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -384,7 +384,13 @@ | |
end | ||
|
||
context 'when using a generic valkyrie adapter', valkyrie_adapter: :test_adapter do | ||
before do | ||
allow(Hyrax).to receive_message_chain(:config, :disable_wings).and_return(true) # rubocop:disable RSpec/MessageChain | ||
hide_const("Wings") # disable_wings=true removes the Wings constant | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It already has a test using a non-wings adapter, but it doesn't fully simulate disabled wings. When it is disabled, the |
||
it 'prepopulates as empty before save' do | ||
expect(Hyrax.logger).to receive(:info) | ||
.with(starting_with("trying to prepopulate a lock token for")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It isn't a change that the logger adds this info message. This expect line just confirms the message was logged. |
||
form.prepopulate! | ||
expect(form.version).to eq '' | ||
end | ||
|
@@ -393,8 +399,9 @@ | |
let(:work) { FactoryBot.valkyrie_create(:hyrax_work) } | ||
|
||
it 'prepopulates empty' do | ||
expect(Hyrax.logger).to receive(:info) | ||
.with(starting_with("trying to prepopulate a lock token for")) | ||
form.prepopulate! | ||
|
||
expect(form.version).to eq '' | ||
end | ||
end | ||
|
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.
The
case
statement didn't allow for checkingdisable_wings
before trying to use theWings
constant. The change is a simple rewrite of thecase
into anif
to allow for the more complex check. The code that is executed for each case is the same.