Sha256: 8c28ee15bb816faecd1f489bdb092c84f40f41b582f56090679d76b13607fd77

Contents?: true

Size: 998 Bytes

Versions: 5

Compression:

Stored size: 998 Bytes

Contents

require 'spec_helper'

describe RightsService do
  before do
    # Configure QA to use fixtures
    qa_fixtures = { local_path: File.expand_path('../../fixtures/authorities', __FILE__) }
    stub_const("Qa::Authorities::LocalSubauthority::AUTHORITIES_CONFIG", qa_fixtures)
  end

  describe "#select_options" do
    it "returns active terms" do
      expect(described_class.select_options).to include(["First Active Term", "demo_id_01"], ["Second Active Term", "demo_id_02"])
    end

    it "does not return inactive terms" do
      expect(described_class.select_options).not_to include(["Third is an Inactive Term", "demo_id_03"], ["Fourth is an Inactive Term", "demo_id_04"])
    end
  end

  describe "#label" do
    it "resolves for ids of active terms" do
      expect(described_class.label('demo_id_01')).to eq("First Active Term")
    end

    it "resolves for ids of inactive terms" do
      expect(described_class.label('demo_id_03')).to eq("Third is an Inactive Term")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
curation_concerns-1.0.0.beta4 spec/services/rights_service_spec.rb
curation_concerns-1.0.0.beta3 spec/services/rights_service_spec.rb
curation_concerns-1.0.0.beta2 spec/services/rights_service_spec.rb
curation_concerns-1.0.0.beta1 spec/services/rights_service_spec.rb
curation_concerns-0.14.0 spec/services/rights_service_spec.rb