Skip to content

Commit

Permalink
revert the changes from 8970a44 and update the assertion to spec/serv…
Browse files Browse the repository at this point in the history
…ices/hyrax/admin_set_create_service_spec.rb:294
  • Loading branch information
alishaevn committed Aug 4, 2023
1 parent b16bace commit f992e10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/services/hyrax/admin_set_create_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def create
# @raise [RuntimeError] if admin set cannot be persisted
def create!
admin_set.creator = [creating_user.user_key] if creating_user
updated_admin_set = Hyrax.persister.save(resource: admin_set, perform_af_validation: true).tap do |result|
updated_admin_set = Hyrax.persister.save(resource: admin_set).tap do |result|
if result
ActiveRecord::Base.transaction do
permission_template = PermissionTemplate.find_by(source_id: result.id.to_s) ||
Expand Down
5 changes: 2 additions & 3 deletions spec/services/hyrax/admin_set_create_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,8 @@
context "when the admin_set is invalid" do
let(:admin_set) { FactoryBot.build(:invalid_hyrax_admin_set) } # Missing title

it 'will not call the workflow_importer' do
expect { service.create! }.to raise_error(RuntimeError)
expect(workflow_importer).not_to have_received(:call)
it 'will not find the sipity workflow' do
expect { service.create! }.to raise_error(ActiveRecord::RecordNotFound)
end
end
end
Expand Down

0 comments on commit f992e10

Please sign in to comment.