Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def self.fileset_for_directives(directives)
.match(/^(.*)-\w*(\.\w+)*$/) { |m| m[1] }
raise "Could not extract fileset id from path #{path}" unless id

Hyrax.metadata_adapter.query_service.find_by(id: id)
Hyrax.query_service.find_by_alternate_identifier(alternate_identifier: id, use_valkyrie: false)
end
private_class_method :fileset_for_directives

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,19 @@
expect(resource.content).to eq("fake file content")
expect(resource.content.encoding).to eq(Encoding::UTF_8)
end

context "when the url is a file:// url" do
subject(:call) do
described_class.call(content,
format: 'txt',
url: "file://#{Hyrax::DerivativePath.derivative_path_for_reference(file_set, 'extracted_text')}",
container: 'extracted_text')
end

it "persists the file to the specified destination on the given object" do
expect(call).to be true
expect(resource.content).to eq("fake file content")
expect(resource.content.encoding).to eq(Encoding::UTF_8)
end
end
end
Loading