Skip to content

Commit

Permalink
add failing test for Wings file_hash behavior
Browse files Browse the repository at this point in the history
Wings appears to be trying to squash out `file_hash`. it looks like ActiveFedora
provides this attribute, but fails any time its set by the end user
  • Loading branch information
tamsin johnson committed Jan 11, 2022
1 parent 6bcbec0 commit 5eb4a29
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/models/hyrax/file_metadata_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@
type: contain_exactly(described_class::Use::ORIGINAL_FILE))
end

context 'when saved with a file' do
subject(:file_metadata) { Hyrax.custom_queries.find_file_metadata_by(id: file.id) }
let(:file_set) { FactoryBot.valkyrie_create(:hyrax_file_set) }

let(:file) do
Hyrax.storage_adapter.upload(resource: file_set,
file: Tempfile.new('blah'),
original_filename: 'blah.txt')
end

it 'can be changed and saved' do
file_metadata.creator = 'Tove'

expect(Hyrax.persister.save(resource: file_metadata).creator)
.to contain_exactly('Tove')
end
end

describe '#original_file?' do
context 'when use says file is the original file' do
before do
Expand Down

0 comments on commit 5eb4a29

Please sign in to comment.