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-0.14.0.pre3 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.14.0.pre2 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.14.0.pre1 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.13.1 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.13.0 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0.pre9 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0.pre8 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0.pre7 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0.pre6 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0.pre5 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0.pre4 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0.pre3 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0.pre2 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.12.0.pre1 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.11.0 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.11.0.rc1 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.10.0 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.9.0 spec/presenters/curation_concerns/permission_badge_spec.rb
curation_concerns-0.8.0 spec/presenters/curation_concerns/permission_badge_spec.rb