Sha256: b5bd2842762796d9df66b20e92a5b3f53402a3d01b8c55bda2c17ae74b2805cb

Contents?: true

Size: 1.28 KB

Versions: 66

Compression:

Stored size: 1.28 KB

Contents

require 'spec_helper'

describe CurationConcerns::LeasePresenter do
  let(:document) { SolrDocument.new(attributes) }
  let(:presenter) { described_class.new(document) }
  let(:attributes) { {} }

  describe "visibility" do
    subject { presenter.visibility }

    it { is_expected.to eq 'restricted' }
  end

  describe "to_s" do
    let(:attributes) { { 'title_tesim' => ['Hey guys!'] } }
    subject { presenter.to_s }

    it { is_expected.to eq 'Hey guys!' }
  end

  describe "human_readable_type" do
    let(:attributes) { { 'human_readable_type_tesim' => ['File'] } }
    subject { presenter.human_readable_type }

    it { is_expected.to eq 'File' }
  end

  describe "lease_expiration_date" do
    let(:attributes) { { 'lease_expiration_date_dtsi' => '2015-10-15T00:00:00Z' } }
    subject { presenter.lease_expiration_date }

    it { is_expected.to eq '15 Oct 2015' }
  end

  describe "visibility_after_lease" do
    let(:attributes) { { 'visibility_after_lease_ssim' => ['restricted'] } }
    subject { presenter.visibility_after_lease }

    it { is_expected.to eq 'restricted' }
  end

  describe "lease_history" do
    let(:attributes) { { 'lease_history_ssim' => ['This is in the past'] } }
    subject { presenter.lease_history }

    it { is_expected.to eq ['This is in the past'] }
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.7.7 spec/presenters/lease_presenter_spec.rb
curation_concerns-2.0.0 spec/presenters/lease_presenter_spec.rb
curation_concerns-2.0.0.rc2 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.7.6 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.7.5 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.7.4 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.7.3 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.7.2 spec/presenters/lease_presenter_spec.rb
curation_concerns-2.0.0.rc1 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.7.1 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.7.0 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.7.0.beta1 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.6.3 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.6.2 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.6.1 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.6.0 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.5.0 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.4.0 spec/presenters/lease_presenter_spec.rb
curation_concerns-1.3.3 spec/presenters/lease_presenter_spec.rb