-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1227 from samvera/full_text_utf8
Update dependencies which saves and retreives charset
- Loading branch information
Showing
3 changed files
with
36 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
12 changes: 7 additions & 5 deletions
12
spec/services/hyrax/persist_directly_contained_output_file_service_spec.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
RSpec.describe Hyrax::PersistDirectlyContainedOutputFileService do | ||
# PersistDirectlyContainedOutputFileService is used by FullTextExtract.output_file_service | ||
let(:object) { FileSet.create! { |fs| fs.apply_depositor_metadata('justin') } } | ||
let(:stream) { "fake file content" } | ||
let(:file_set) { FileSet.create! { |fs| fs.apply_depositor_metadata('justin') } } | ||
let(:content) { "fake file content" } | ||
subject(:call) do | ||
described_class.call(stream, | ||
described_class.call(content, | ||
format: 'txt', | ||
url: object.uri, | ||
url: file_set.uri, | ||
container: 'extracted_text') | ||
end | ||
let(:resource) { file_set.reload.extracted_text } | ||
|
||
it "persists the file to the specified destination on the given object" do | ||
expect(call).to be true | ||
expect(object.reload.extracted_text.content).to eq("fake file content") | ||
expect(resource.content).to eq("fake file content") | ||
expect(resource.content.encoding).to eq(Encoding::UTF_8) | ||
end | ||
end |