Skip to content

Commit

Permalink
🧹 Update spec to reflect AdminSet default behavior
Browse files Browse the repository at this point in the history
In the following commit, we removed the deprecated
`AdminSet.find_or_create_default_admin_set_id`:

- samvera/hyrax@863c4bc

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:

- samvera/hyrax#6203
  • Loading branch information
jeremyf committed Dec 20, 2023
1 parent 8272321 commit ecbf83e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/services/create_account_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ecbf83e

Please sign in to comment.