Sha256: 900e717bf509ec2da76ed7e310d0b6a7aa907cc55c91ab1062663ad1e58b9207

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__) }
    stub_const("Qa::Authorities::LocalSubauthority::AUTHORITIES_CONFIG", 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.1.0 spec/services/rights_service_spec.rb
curation_concerns-1.0.0 spec/services/rights_service_spec.rb
curation_concerns-1.0.0.beta10 spec/services/rights_service_spec.rb
curation_concerns-1.0.0.beta9 spec/services/rights_service_spec.rb
curation_concerns-1.0.0.beta8 spec/services/rights_service_spec.rb
curation_concerns-1.0.0.beta7 spec/services/rights_service_spec.rb
curation_concerns-1.0.0.beta6 spec/services/rights_service_spec.rb
curation_concerns-1.0.0.beta5 spec/services/rights_service_spec.rb