Sha256: 6cd605d594822033dba1a5c2e7c31fce152a5b98d5f88d6b70b15dbbc9e2208c

Contents?: true

Size: 1.23 KB

Versions: 12

Compression:

Stored size: 1.23 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 "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

12 entries across 12 versions & 1 rubygems

Version Path
ddr-models-3.0.0.beta.11 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.10 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.9 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.8 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.7 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.6 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.4 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.3 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.2 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.beta.1 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.alpha.4 spec/models/descriptive_metadata_spec.rb
ddr-models-3.0.0.alpha.3 spec/models/descriptive_metadata_spec.rb