Sha256: a54598246f3756c6f087f892e67f198787e492a275a3da49bc17e9b5821d3c7f

Contents?: true

Size: 966 Bytes

Versions: 24

Compression:

Stored size: 966 Bytes

Contents

require 'spec_helper'

module Ddr::Models
  RSpec.describe AdministrativeMetadata do

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

    describe ".property_term" do
      it "should return the correct property term" do
        expect(described_class.property_term(:local_id)).to eq(:local_id)
        expect(described_class.property_term('local_id')).to eq(:local_id)
      end
    end

    describe "using the set_values and add_value methods" do
      let(:ds) { described_class.new(obj) }
      before { ds.local_id = 'foo001' }
      describe "#set_values" do
        it "should set the value of the term to the one supplied" do
          ds.set_value :local_id, 'bar002'
          expect(ds.local_id).to eq('bar002')
        end
      end
      describe "#add_value" do
        it "should set the term value to the supplied value" do
          ds.add_value :local_id, 'bar002'
          expect(ds.local_id).to eq('bar002')
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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