Skip to content
Snippets Groups Projects
Commit dfe017b1 authored by mo khan's avatar mo khan :two:
Browse files

Use a FactoryBot trait to improve readability

parent e045b5da
No related branches found
No related tags found
1 merge request!174087Use a FactoryBot trait to improve readability
......@@ -3918,21 +3918,21 @@ def webhook_headers
end
it 'returns false when there are not enough seats if the custom role is billable' do
custom_role = create(:member_role, base_access_level: ::Gitlab::Access::GUEST, permissions: { remove_project: true })
custom_role = create(:member_role, :guest, :remove_project)
user_ids = %w[1 2 3]
expect(group.seats_available_for?(user_ids, ::Gitlab::Access::GUEST, custom_role.id)).to eq(false)
end
it 'returns true even if there are not enough seats if the custom role is not billable' do
custom_role = create(:member_role, base_access_level: ::Gitlab::Access::GUEST, permissions: { read_code: true })
custom_role = create(:member_role, :guest, :read_code)
user_ids = %w[1 2 3]
expect(group.seats_available_for?(user_ids, ::Gitlab::Access::GUEST, custom_role.id)).to eq(true)
end
it 'returns false when there are not enough seats if the custom role is billable and uses minimal access as its base' do
custom_role = create(:member_role, base_access_level: ::Gitlab::Access::MINIMAL_ACCESS, permissions: { remove_project: true })
custom_role = create(:member_role, :minimal_access, :remove_project)
user_ids = %w[1 2 3]
expect(group.seats_available_for?(user_ids, ::Gitlab::Access::MINIMAL_ACCESS, custom_role.id)).to eq(false)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment