Skip to content

Commit

Permalink
Edit edit_file_spec.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
abelemlih committed Dec 11, 2023
1 parent e981e1c commit 182bb42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/features/edit_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
let!(:workflow) { create(:workflow, allows_access_grant: true, active: true, permission_template_id: permission_template.id) }

let(:admin_set) do
if Hyrax.config.use_valkyrie?
if Hyrax.config.disable_wings
valkyrie_create(:hyrax_admin_set)
else
create(:admin_set)
end
end

let!(:work) do
if Hyrax.config.use_valkyrie?
if Hyrax.config.disable_wings
valkyrie_create(:monograph, depositor: user.user_key, admin_set_id: admin_set.id, members: [file_set])
else
build(:work, user: user, admin_set_id: admin_set.id)
end
end

let(:file_set) do
if Hyrax.config.use_valkyrie?
if Hyrax.config.disable_wings
valkyrie_create(:hyrax_file_set, :with_files, title: ['Test File Set'], depositor: user.user_key, read_groups: ['public'], edit_users: [user])
else
create(:file_set, title: ['Test File Set'], user: user, read_groups: ['public'], edit_users: [user])
Expand All @@ -33,7 +33,7 @@
before do
sign_in user

unless Hyrax.config.use_valkyrie?
unless Hyrax.config.disable_wings
Hydra::Works::AddFileToFileSet.call(file_set, file, :original_file)
work.ordered_members << file_set
work.save!
Expand Down

0 comments on commit 182bb42

Please sign in to comment.