Skip to content

Commit

Permalink
Merge pull request #2082 from samvera/hyrax-5-upgrade-replace-admin-s…
Browse files Browse the repository at this point in the history
…et-generation-method

🧹 Update spec to reflect AdminSet default behavior
  • Loading branch information
jeremyf authored Dec 20, 2023
2 parents 71a303f + ecbf83e commit 57bf77c
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 57bf77c

Please sign in to comment.