Commit c14c5a27 authored by charlie ablett's avatar charlie ablett

Tweak test to assert equality of specs

parent 19d81601
...@@ -6728,20 +6728,17 @@ RSpec.describe Project, factory_default: :keep do ...@@ -6728,20 +6728,17 @@ RSpec.describe Project, factory_default: :keep do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:maintainer) { create(:user) } let_it_be(:maintainer) { create(:user) }
before do let(:owner_membership) { project.members.owners.find_by(user_id: project.namespace.owner_id) }
project.add_maintainer(maintainer)
end
it 'includes the owner of the personal project' do it 'includes only the owner of the personal project' do
project_owner_membership = project.members.owners.find_by(user_id: project.namespace.owner_id) expect(project.access_request_approvers_to_be_notified.to_a).to eq([owner_membership])
expect(project.access_request_approvers_to_be_notified).to include(project_owner_membership)
end end
it 'includes the maintainers of the personal project, if any' do it 'includes the maintainers of the personal project, if any' do
project_maintainer_membership = project.members.maintainers.find_by(user_id: maintainer.id) project.add_maintainer(maintainer)
maintainer_membership = project.members.maintainers.find_by(user_id: maintainer.id)
expect(project.access_request_approvers_to_be_notified).to include(project_maintainer_membership) expect(project.access_request_approvers_to_be_notified.to_a).to match_array([owner_membership, maintainer_membership])
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment