Sha256: cbfb68d55ebe263ce5f79ca09eaf4b4be532586fc7a50ae2d84d4954df32d23b

Contents?: true

Size: 1.12 KB

Versions: 66

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe CurationConcerns::PermissionBadge do
  let(:badge) { described_class.new(solr_doc) }
  let(:solr_doc) { SolrDocument.new(attributes) }
  let(:attributes) { {} }

  describe "#render" do
    subject { badge.render }
    context "when open-access with embargo" do
      let(:attributes) { { read_access_group_ssim: ['public'], embargo_release_date_dtsi: '2016-05-04' } }
      it { is_expected.to eq "<span title=\"Open Access with Embargo\" class=\"label label-warning\">Open Access with Embargo</span>" }
    end

    context "when open-access" do
      let(:attributes) { { read_access_group_ssim: ['public'] } }
      it { is_expected.to eq "<span title=\"Open Access\" class=\"label label-success\">Open Access</span>" }
    end

    context "when registered" do
      let(:attributes) { { read_access_group_ssim: ['registered'] } }
      it { is_expected.to eq "<span title=\"Institution Name\" class=\"label label-info\">Institution Name</span>" }
    end

    context "when private" do
      it { is_expected.to eq "<span title=\"Private\" class=\"label label-danger\">Private</span>" }
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

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