spec/unit/permissions_spec.rb in hydra-access-controls-10.3.4 vs spec/unit/permissions_spec.rb in hydra-access-controls-10.4.0.rc1
- old
+ new
@@ -132,10 +132,11 @@
end
it "removes permissions on existing users" do
indexed_result = ActiveFedora::SolrService.query("id:#{subject.id}").first['edit_access_person_ssim']
expect(indexed_result).to eq ['jcoyne']
+ expect(subject.permissions.map(&:to_hash)).to eq [{ name: "jcoyne", type: "person", access: "edit" }]
expect(reloaded).to eq [{ name: "jcoyne", type: "person", access: "edit" }]
end
end
context "when updating groups" do
@@ -186,10 +187,10 @@
before do
subject.update permissions_attributes: [{ type: "group", access: "read", name: "group1" }]
subject.update permissions_attributes: [
{ id: permissions_id, type: "group", access: "read", name: "group1", _destroy: '1' },
{ type: "group", access: "edit", name: "group2" },
- { type: "person", access: "read", name: "joebob" }
+ { type: "person", access: "read", name: "joebob" }
]
end
it "removes permissions on existing groups and updates the others" do
expect(reloaded).to contain_exactly(