From 821797123c35ae2a318368edf797d359461fa1d9 Mon Sep 17 00:00:00 2001 From: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com> Date: Thu, 24 Mar 2022 11:32:10 -0700 Subject: [PATCH] Major version bump v3.0.0.beta1 (#445) * first beta release for v3.0.0 * fix specs --- Gemfile.lock | 2 +- lib/bulkrax/version.rb | 2 +- spec/models/bulkrax/csv_entry_spec.rb | 36 +++++++++++++++++++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6e0fec96..414422df 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,7 +10,7 @@ GIT PATH remote: . specs: - bulkrax (2.3.0) + bulkrax (3.0.0.beta1) bagit (~> 0.4) coderay iso8601 (~> 0.9.0) diff --git a/lib/bulkrax/version.rb b/lib/bulkrax/version.rb index 712d542d..150d1253 100644 --- a/lib/bulkrax/version.rb +++ b/lib/bulkrax/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Bulkrax - VERSION = '2.3.0' + VERSION = '3.0.0.beta1' end diff --git a/spec/models/bulkrax/csv_entry_spec.rb b/spec/models/bulkrax/csv_entry_spec.rb index 7b1e7b23..8381f04e 100644 --- a/spec/models/bulkrax/csv_entry_spec.rb +++ b/spec/models/bulkrax/csv_entry_spec.rb @@ -6,10 +6,20 @@ module Bulkrax RSpec.describe CsvEntry, type: :model do let(:collection) { FactoryBot.build(:collection) } + let(:hyrax_record) do + OpenStruct.new( + file_sets: [], + member_of_collections: [], + member_of_work_ids: [], + in_work_ids: [], + member_work_ids: [] + ) + end before do allow_any_instance_of(described_class).to receive(:collections_created?).and_return(true) allow_any_instance_of(described_class).to receive(:find_collection).and_return(collection) + allow(subject).to receive(:hyrax_record).and_return(hyrax_record) end describe 'builds entry' do @@ -398,6 +408,9 @@ module Bulkrax allow_any_instance_of(ObjectFactory).to receive(:run!) allow(subject).to receive(:hyrax_record).and_return(work_obj) allow(work_obj).to receive(:id).and_return('test123') + allow(work_obj).to receive(:member_of_work_ids).and_return([]) + allow(work_obj).to receive(:in_work_ids).and_return([]) + allow(work_obj).to receive(:member_work_ids).and_return([]) end it 'succeeds' do @@ -436,6 +449,9 @@ module Bulkrax allow_any_instance_of(ObjectFactory).to receive(:run!) allow(subject).to receive(:hyrax_record).and_return(work_obj) allow(work_obj).to receive(:id).and_return('test123') + allow(work_obj).to receive(:member_of_work_ids).and_return([]) + allow(work_obj).to receive(:in_work_ids).and_return([]) + allow(work_obj).to receive(:member_work_ids).and_return([]) end it 'succeeds' do @@ -483,6 +499,9 @@ module Bulkrax allow_any_instance_of(ObjectFactory).to receive(:run!) allow(subject).to receive(:hyrax_record).and_return(work_obj) allow(work_obj).to receive(:id).and_return('test123') + allow(work_obj).to receive(:member_of_work_ids).and_return([]) + allow(work_obj).to receive(:in_work_ids).and_return([]) + allow(work_obj).to receive(:member_work_ids).and_return([]) end it 'succeeds' do @@ -533,6 +552,9 @@ module Bulkrax allow_any_instance_of(ObjectFactory).to receive(:run!) allow(subject).to receive(:hyrax_record).and_return(work_obj) allow(work_obj).to receive(:id).and_return('test123') + allow(work_obj).to receive(:member_of_work_ids).and_return([]) + allow(work_obj).to receive(:in_work_ids).and_return([]) + allow(work_obj).to receive(:member_work_ids).and_return([]) end it 'succeeds' do @@ -580,6 +602,9 @@ module Bulkrax allow_any_instance_of(ObjectFactory).to receive(:run!) allow(subject).to receive(:hyrax_record).and_return(work_obj) allow(work_obj).to receive(:id).and_return('test123') + allow(work_obj).to receive(:member_of_work_ids).and_return([]) + allow(work_obj).to receive(:in_work_ids).and_return([]) + allow(work_obj).to receive(:member_work_ids).and_return([]) end it 'succeeds' do @@ -627,6 +652,9 @@ module Bulkrax allow_any_instance_of(ObjectFactory).to receive(:run!) allow(subject).to receive(:hyrax_record).and_return(work_obj) allow(work_obj).to receive(:id).and_return('test123') + allow(work_obj).to receive(:member_of_work_ids).and_return([]) + allow(work_obj).to receive(:in_work_ids).and_return([]) + allow(work_obj).to receive(:member_work_ids).and_return([]) end it 'succeeds' do @@ -644,7 +672,7 @@ module Bulkrax describe '#build_relationship_metadata' do subject(:entry) { described_class.new(importerexporter: exporter) } - let(:exporter) { create(:bulkrax_exporter) } + let(:exporter) { create(:bulkrax_exporter, :with_relationships_mappings) } let(:hyrax_record) do OpenStruct.new( has_model: ['Work'], @@ -656,6 +684,8 @@ module Bulkrax before do allow(entry).to receive(:hyrax_record).and_return(hyrax_record) + allow(entry).to receive(:source_identifier).and_return('source_identifier') + allow(entry).to receive(:work_identifier).and_return('source') end it 'gets called by #build_export_metadata' do @@ -738,7 +768,7 @@ module Bulkrax describe '#build_files' do subject(:entry) { described_class.new(importerexporter: exporter) } - let(:exporter) { create(:bulkrax_exporter) } + let(:exporter) { create(:bulkrax_exporter, :with_relationships_mappings) } before do allow(entry).to receive(:hyrax_record).and_return(hyrax_record) @@ -757,6 +787,8 @@ module Bulkrax before do allow(hyrax_record).to receive(:is_a?).with(FileSet).and_return(false) allow(hyrax_record).to receive(:is_a?).with(Collection).and_return(true) + allow(entry).to receive(:source_identifier).and_return('source_identifier') + allow(entry).to receive(:work_identifier).and_return('source') end it 'does not get called by #build_export_metadata' do