Skip to content

Commit

Permalink
Merge pull request #6564 from samvera/updates_permissions_create_serv…
Browse files Browse the repository at this point in the history
…ice_spec

Requeries collection and admin_set objects in `spec/services/hyrax/collections/permissions_create_service_spec.rb`.
  • Loading branch information
dlpierce authored Jan 3, 2024
2 parents 820f77d + 8c2cae0 commit 53a0ef2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
RSpec.describe Hyrax::Collections::PermissionsCreateService do
let(:user) { FactoryBot.create(:user) }
let(:user2) { FactoryBot.create(:user) }
let(:query_service) { Hyrax.query_service }

describe ".create_default" do
let(:collection_type) { FactoryBot.create(:collection_type) }
Expand Down Expand Up @@ -87,7 +88,8 @@
.by(1)

# collection depositors are granted read access to the collection
expect(collection.permission_manager.read_groups)
pulled_collection = query_service.find_by(id: collection.id)
expect(pulled_collection.permission_manager.read_groups.to_a)
.to include 'archivist'
end
end
Expand All @@ -106,7 +108,8 @@
.by(1)

# collection depositors are granted read access to the collection
expect(admin_set.permission_manager.read_groups)
pulled_admin_set = query_service.find_by(id: admin_set.id)
expect(pulled_admin_set.permission_manager.read_groups.to_a)
.to include 'archivist'
end
end
Expand Down

0 comments on commit 53a0ef2

Please sign in to comment.