Sha256: 5d77fb3e5b5e68b88f65bd2afe53d503af647cfe090b48e87b44538ed20c8a8f

Contents?: true

Size: 864 Bytes

Versions: 2

Compression:

Stored size: 864 Bytes

Contents

require 'spec_helper'

describe Krikri::Mapping do

  let(:record) { build(:oai_dc_record) }

  describe '#process_record' do
    it 'creates a DPLA::MAP record' do
      expect(subject.process_record(record)).to be_a DPLA::MAP::Aggregation
    end

    it 'builds target class set in initializer' do
      klass = DPLA::MAP::SourceResource
      new_mapping = Krikri::Mapping.new(klass)
      expect(new_mapping.process_record(record)).to be_a klass
    end

    context 'with static properties' do
      before do
        subject.rightsStatement value
      end

      subject { described_class.new }
      let(:value) { 'Rights Reserved; Moomin Access Only' }

      it 'sets value' do
        expect_any_instance_of(DPLA::MAP::Aggregation)
          .to receive(:rightsStatement=).with(value)
        subject.process_record(record)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
krikri-0.1.1 spec/lib/krikri/mapping_spec.rb
krikri-0.1.0 spec/lib/krikri/mapping_spec.rb