Sha256: 0aad705ae06f9c9814bb4138eb62295a8e9b5654c1dac14db495a1017a0e79e4

Contents?: true

Size: 1.48 KB

Versions: 24

Compression:

Stored size: 1.48 KB

Contents

require 'spec_helper'

module Ddr::Models
  RSpec.describe DescriptiveMetadata do

    let(:obj) { FactoryGirl.build(:item) }

    describe "terminology" do
      subject { described_class.unqualified_names }
      it { is_expected.to_not include(:license) }
      it "should have a term for each term name in the RDF::DC vocab, except :license" do
        expect(subject).to include(*(Ddr::Vocab::Vocabulary.term_names(RDF::DC) - [:license]))
      end
      it "should have a term for each term name in the DukeTerms vocab" do
        expect(subject).to include(*Ddr::Vocab::Vocabulary.term_names(Ddr::Vocab::DukeTerms))
      end
    end
    describe ".property_term" do
      it "should return the correct property term" do
        expect(described_class.property_term(:subject)).to eq(:dc_subject)
        expect(described_class.property_term('subject')).to eq(:dc_subject)
      end
    end
    describe "using the set_values and add_value methods" do
      let(:ds) { described_class.new(obj) }
      before { ds.type = ["Photograph"] }
      describe "#set_values" do
        it "should set the values of the term to those supplied" do
          ds.set_values :type, [ "Image", "Still Image" ]
          expect(ds.type).to eq([ "Image", "Still Image" ])
        end
      end
      describe "#add_value" do
        it "should add the supplied value to those of the term" do
          ds.add_value :type, "Image"
          expect(ds.type).to eq([ "Photograph", "Image" ])
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ddr-models-3.0.8 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.7 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.6 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.5 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.4 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.3 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.2 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.1 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.rc6 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.rc5 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.rc4 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.rc3 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.rc2 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.rc1 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.22 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.21 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.20 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.18 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.17 spec/models/descriptive_metadata_spec.rb