From 4acebd92876a6a4f4974a505ee22a0cc8abaaaf4 Mon Sep 17 00:00:00 2001 From: tamsin johnson Date: Thu, 28 Oct 2021 11:48:20 -0700 Subject: [PATCH] test AdminAdminSetMemberSearchBuilder for collection search update specs to ensure the correct models are included in the search: - always include `Collection`, - include configured collection model name, - include registered curationconcerns should the implementation be updated to search using the indexed generic type? --- .../admin_admin_set_member_search_builder_spec.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spec/search_builders/hyrax/admin_admin_set_member_search_builder_spec.rb b/spec/search_builders/hyrax/admin_admin_set_member_search_builder_spec.rb index 108aa82028..d8f1bb87f0 100644 --- a/spec/search_builders/hyrax/admin_admin_set_member_search_builder_spec.rb +++ b/spec/search_builders/hyrax/admin_admin_set_member_search_builder_spec.rb @@ -13,7 +13,17 @@ it 'searches for valid work types' do expect(builder.filter_models(solr_params)) - .to contain_exactly("{!terms f=has_model_ssim}Monograph,#{Hyrax.config.collection_class}") + .to contain_exactly(include("{!terms f=has_model_ssim}Monograph")) + end + + it 'searches for collections indexed as ActiveFedora' do + expect(builder.filter_models(solr_params)) + .to contain_exactly(include("Collection")) + end + + it 'searches for collections indexed as valkyrie' do + expect(builder.filter_models(solr_params)) + .to contain_exactly(include(Hyrax.config.collection_class.to_s)) end it 'does not limit to active only' do