Sha256: a2e067b2caed9786fedb646744c6db3e18d0339dcbebab3a4bba00fc45fbb997

Contents?: true

Size: 1.23 KB

Versions: 18

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe CurationConcerns::LicenseService do
  before do
    # Configure QA to use fixtures
    qa_fixtures = { local_path: File.expand_path('spec/fixtures/authorities') }
    allow(Qa::Authorities::Local).to receive(:config).and_return(qa_fixtures)
  end
  let(:service) { described_class.new }

  describe "#select_active_options" do
    it "returns active terms" do
      expect(service.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(service.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(service.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(service.label('demo_id_01')).to eq("First Active Term")
    end

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

Version data entries

18 entries across 18 versions & 1 rubygems

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