Sha256: 7566933810269c2eb6a379233cc38b7b3ea91929824408d45df39244cca96e84
Contents?: true
Size: 1.29 KB
Versions: 29
Compression:
Stored size: 1.29 KB
Contents
require 'spec_helper' describe CurationConcerns::EmbargoActor do let(:actor) { described_class.new(work) } let(:work) do GenericWork.new do |work| work.apply_depositor_metadata 'foo' work.title = ["test"] work.visibility = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED work.visibility_during_embargo = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED work.visibility_after_embargo = Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC work.embargo_release_date = release_date.to_s work.save(validate: false) end end describe "#destroy" do context "with an active embargo" do let(:release_date) { Date.today + 2 } it "removes the embargo" do actor.destroy expect(work.reload.embargo_release_date).to be_nil expect(work.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED end end context 'with an expired embargo' do let(:release_date) { Date.today - 2 } it "removes the embargo" do actor.destroy expect(work.reload.embargo_release_date).to be_nil expect(work.visibility).to eq Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC end end end end
Version data entries
29 entries across 29 versions & 1 rubygems