Sha256: 2b9c927476edc9e4efb48850760412b9c0f111bdb280d79c3e461fe04ef76ca8

Contents?: true

Size: 721 Bytes

Versions: 11

Compression:

Stored size: 721 Bytes

Contents

module Ddr::Models
  RSpec.describe License do

    describe ".call" do
      subject { described_class.call(obj) }

      describe "when the object has a license URL" do
        let(:url) { "http://example.com" }
        let(:obj) { double(pid: "test:1", license: url) }
        before do
          allow(described_class).to receive(:find).with(url: url) { described_class.new(url: url, title: "A License") }
        end
        its(:pid) { is_expected.to eq("test:1") }
        its(:to_s) { is_expected.to eq("A License") }
      end

      describe "when the object does not have a license" do
        let(:obj) { double(pid: "test:1", license: nil) }
        it { is_expected.to be_nil }
      end
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ddr-models-2.3.2 spec/models/license_spec.rb
ddr-models-2.3.1 spec/models/license_spec.rb
ddr-models-2.3.0 spec/models/license_spec.rb
ddr-models-3.0.0.alpha.2 spec/models/license_spec.rb
ddr-models-3.0.0.alpha.1 spec/models/license_spec.rb
ddr-models-2.2.0 spec/models/license_spec.rb
ddr-models-2.1.3 spec/models/license_spec.rb
ddr-models-2.1.2 spec/models/license_spec.rb
ddr-models-2.1.1 spec/models/license_spec.rb
ddr-models-2.1.0 spec/models/license_spec.rb
ddr-models-2.1.0.rc2 spec/models/license_spec.rb