Sha256: f2fc486e3b1e60aaecfa96d697dfef8d8aa4c4f8c6115cea3d7ab9a243b79d63

Contents?: true

Size: 1.23 KB

Versions: 8

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe RightsService do
  before do
    # Configure QA to use fixtures
    qa_fixtures = { local_path: File.expand_path('../../fixtures/authorities', __FILE__) }
    allow(Qa::Authorities::Local).to receive(:config).and_return(qa_fixtures)
  end

  describe "#select_active_options" do
    it "returns active terms" do
      expect(described_class.select_active_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_active_options).not_to include(["Third is an Inactive Term", "demo_id_03"], ["Fourth is an Inactive Term", "demo_id_04"])
    end
  end

  describe "#select_all_options" do
    it "returns both active and inactive terms" do
      expect(described_class.select_all_options).to include(["Fourth is an Inactive Term", "demo_id_04"], ["First Active Term", "demo_id_01"])
    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

8 entries across 8 versions & 1 rubygems

Version Path
curation_concerns-1.4.0 spec/services/rights_service_spec.rb
curation_concerns-1.3.3 spec/services/rights_service_spec.rb
curation_concerns-1.3.2 spec/services/rights_service_spec.rb
curation_concerns-1.3.1 spec/services/rights_service_spec.rb
curation_concerns-1.3.0 spec/services/rights_service_spec.rb
curation_concerns-1.2.0 spec/services/rights_service_spec.rb
curation_concerns-1.1.2 spec/services/rights_service_spec.rb
curation_concerns-1.1.1 spec/services/rights_service_spec.rb