From ecbf83e31fdff1d711043d754822247fd891ea75 Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Wed, 20 Dec 2023 09:51:00 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Update=20spec=20to=20reflect=20A?= =?UTF-8?q?dminSet=20default=20behavior?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the following commit, we removed the deprecated `AdminSet.find_or_create_default_admin_set_id`: - https://github.com/samvera/hyrax/commit/863c4bc177702b3aa00ad01f93e7a3d214bb2d73 This commit follows the advice of the deprecation warning and now favors the `Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id` method call. Related to: - https://github.com/samvera/hyrax/pull/6203 --- spec/services/create_account_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/services/create_account_spec.rb b/spec/services/create_account_spec.rb index d1825a433..262a68503 100644 --- a/spec/services/create_account_spec.rb +++ b/spec/services/create_account_spec.rb @@ -4,6 +4,7 @@ subject { described_class.new(account) } let(:account) { FactoryBot.build(:sign_up_account) } + let(:stubbed_admin_set) { double(AdminSet, id: "admin_set/id") } describe '#create_tenant' do it 'creates a new apartment tenant' do @@ -15,7 +16,7 @@ expect(Apartment::Tenant).to receive(:create).with(any_args) do |&block| block.call end - expect(AdminSet).to receive(:find_or_create_default_admin_set_id) + expect(Hyrax::AdminSetCreateService).to receive(:find_or_create_default_admin_set).and_return(stubbed_admin_set) subject.save expect(Site.reload.account).to eq account end @@ -59,7 +60,7 @@ expect(RolesService).to receive(:create_default_hyrax_groups_with_roles!) expect(Hyrax::CollectionType).to receive(:find_or_create_default_collection_type) expect(Hyrax::CollectionType).to receive(:find_or_create_admin_set_type) - expect(AdminSet).to receive(:find_or_create_default_admin_set_id) + expect(Hyrax::AdminSetCreateService).to receive(:find_or_create_default_admin_set).and_return(stubbed_admin_set) account.create_defaults end