Skip to content

Commit

Permalink
Merge pull request #6748 from samvera/find_files-specs
Browse files Browse the repository at this point in the history
use `find_files(file_set: file_set)` in various specs
  • Loading branch information
dlpierce authored Mar 28, 2024
2 parents fcbfe93 + 7874612 commit 215e285
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spec/controllers/hyrax/file_sets_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@
let(:file) { fixture_file_upload('/world.png', 'image/png') }
let(:work) { FactoryBot.valkyrie_create(:hyrax_work, title: "test title", uploaded_files: [FactoryBot.create(:uploaded_file, user: work_user)], edit_users: [work_user]) }
let(:file_set) { query_service.find_members(resource: work).first }
let(:file_metadata) { query_service.custom_queries.find_file_metadata_by(id: file_set.file_ids.first) }
let(:file_metadata) { query_service.custom_queries.find_files(file_set: file_set).first }
let(:uploaded) { storage_adapter.find_by(id: file_metadata.file_identifier) }
let(:query_service) { Hyrax.query_service }
let(:storage_adapter) { Hyrax.storage_adapter }
Expand Down
2 changes: 1 addition & 1 deletion spec/hyrax/transactions/file_set_destroy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
context "with attached files" do
let(:work) { FactoryBot.valkyrie_create(:hyrax_work, uploaded_files: [FactoryBot.create(:uploaded_file)], edit_users: [user]) }
let(:file_set) { query_service.find_members(resource: work).first }
let(:file_metadata) { query_service.custom_queries.find_file_metadata_by(id: file_set.file_ids.first) }
let(:file_metadata) { query_service.custom_queries.find_files(file_set: file_set).first }
let(:uploaded) { storage_adapter.find_by(id: file_metadata.file_identifier) }
let(:storage_adapter) { Hyrax.storage_adapter }
let(:query_service) { Hyrax.query_service }
Expand Down
2 changes: 1 addition & 1 deletion spec/hyrax/transactions/work_destroy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
context "with attached files" do
let(:work) { FactoryBot.valkyrie_create(:hyrax_work, uploaded_files: [FactoryBot.create(:uploaded_file)], edit_users: [user]) }
let(:file_set) { query_service.find_members(resource: work).first }
let(:file_metadata) { query_service.custom_queries.find_file_metadata_by(id: file_set.file_ids.first) }
let(:file_metadata) { query_service.custom_queries.find_files(file_set: file_set).first }
let(:uploaded) { storage_adapter.find_by(id: file_metadata.file_identifier) }
let(:storage_adapter) { Hyrax.storage_adapter }
let(:query_service) { Hyrax.query_service }
Expand Down
2 changes: 1 addition & 1 deletion spec/presenters/hyrax/version_list_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
let(:file) { fixture_file_upload('/world.png', 'image/png') }
let(:work) { FactoryBot.valkyrie_create(:hyrax_work, uploaded_files: [FactoryBot.create(:uploaded_file)]) }
let(:file_set) { query_service.find_members(resource: work).first }
let(:file_metadata) { query_service.custom_queries.find_file_metadata_by(id: file_set.file_ids.first) }
let(:file_metadata) { query_service.custom_queries.find_files(file_set: file_set).first }
let(:uploaded) { storage_adapter.find_by(id: file_metadata.file_identifier) }
let(:query_service) { Hyrax.query_service }
let(:storage_adapter) { Hyrax.storage_adapter }
Expand Down

0 comments on commit 215e285

Please sign in to comment.