Sha256: 4337cc8ca7670bd7d3f2501206b19d74a5793d7a01d284cc090a9dbd5ac5ce97
Contents?: true
Size: 1.72 KB
Versions: 57
Compression:
Stored size: 1.72 KB
Contents
require 'spec_helper' describe VisibilityCopyJob do describe 'an open access work' do let(:work) { create(:work_with_files) } it 'copies visibility to its contained files' do # files are private at the outset expect(work.file_sets.first.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE work.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC work.save described_class.perform_now(work) work.reload.file_sets.each do |file| expect(file.visibility).to eq 'open' end end end describe 'an embargoed work' do let(:work) { create(:embargoed_work_with_files) } before do expect(work.visibility).to eq 'restricted' expect(work).to be_under_embargo expect(work.file_sets.first).to_not be_under_embargo end before do described_class.perform_now(work) work.reload end let(:file) { work.file_sets.first } it 'copies visibility to its contained files and apply a copy of the embargo to the files' do expect(file).to be_under_embargo expect(file.embargo.id).to_not eq work.embargo.id end end describe 'an leased work' do let(:work) { create(:leased_work_with_files) } before do expect(work.visibility).to eq 'open' expect(work).to be_active_lease expect(work.file_sets.first).to_not be_active_lease end before do described_class.perform_now(work) work.reload end let(:file) { work.file_sets.first } it 'copies visibility to its contained files and apply a copy of the lease to the files' do expect(file).to be_active_lease expect(file.lease.id).to_not eq work.lease.id end end end
Version data entries
57 entries across 57 versions & 1 rubygems