From 37fd5ae3a977c0978cbbf2001a4cc577b5031be9 Mon Sep 17 00:00:00 2001 From: "E. Lynette Rayle" Date: Tue, 17 Aug 2021 13:36:59 -0400 Subject: [PATCH] collection needs to be persisted to have an id Setting the relationship of nested collections through Valkyrie resources in the CollectionMemberService requires that the parent collection have an id assigned to be able to store the id in the child. The previous approach through AF took care of establishing the relationship. --- spec/models/concerns/hyrax/collection_nesting_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/concerns/hyrax/collection_nesting_spec.rb b/spec/models/concerns/hyrax/collection_nesting_spec.rb index 29be4b1983..a99c83a956 100644 --- a/spec/models/concerns/hyrax/collection_nesting_spec.rb +++ b/spec/models/concerns/hyrax/collection_nesting_spec.rb @@ -32,7 +32,7 @@ def after_save end let(:user) { create(:user) } - let!(:collection) { build(:collection_lw, collection_type_settings: [:nestable]) } + let!(:collection) { create(:collection_lw, collection_type_settings: [:nestable]) } let!(:child_collection) { create(:collection_lw, collection_type_settings: [:nestable]) } let(:extent) { Hyrax::Adapters::NestingIndexAdapter::FULL_REINDEX }