Commit 277e9e4e authored by Stan Hu's avatar Stan Hu

Add a spec for access_for_user_ids

parent a85d24fc
...@@ -79,6 +79,18 @@ describe Member, models: true do ...@@ -79,6 +79,18 @@ describe Member, models: true do
@accepted_request_member = project.requesters.find_by(user_id: accepted_request_user.id).tap { |m| m.accept_request } @accepted_request_member = project.requesters.find_by(user_id: accepted_request_user.id).tap { |m| m.accept_request }
end end
describe '.access_for_user_ids' do
it 'returns the right access levels' do
users = [@owner_user.id, @master_user.id]
expected = {
@owner_user.id => Gitlab::Access::OWNER,
@master_user.id => Gitlab::Access::MASTER
}
expect(described_class.access_for_user_ids(users)).to eq(expected)
end
end
describe '.invite' do describe '.invite' do
it { expect(described_class.invite).not_to include @master } it { expect(described_class.invite).not_to include @master }
it { expect(described_class.invite).to include @invited_member } it { expect(described_class.invite).to include @invited_member }
......
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