Sha256: ef7d627676829db4701210c3e8ef717fb0b0a5a2de351de9cc4d7b5ad2ee4cc1

Contents?: true

Size: 1.22 KB

Versions: 10

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'

describe Hyrax::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

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 spec/services/hyrax/license_service_spec.rb
hyrax-1.1.0 spec/services/hyrax/license_service_spec.rb
hyrax-1.0.5 spec/services/hyrax/license_service_spec.rb
hyrax-1.0.4 spec/services/hyrax/license_service_spec.rb
hyrax-1.0.3 spec/services/hyrax/license_service_spec.rb
hyrax-1.0.2 spec/services/hyrax/license_service_spec.rb
hyrax-1.0.1 spec/services/hyrax/license_service_spec.rb
hyrax-1.0.0.rc2 spec/services/hyrax/license_service_spec.rb
hyrax-1.0.0.rc1 spec/services/hyrax/license_service_spec.rb
test_hyrax-0.0.1.alpha spec/services/hyrax/license_service_spec.rb