debian-mirror-gitlab/spec/services/members/creator_service_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
868 B
Ruby
Raw Normal View History

2022-06-21 17:19:12 +05:30
# frozen_string_literal: true
require 'spec_helper'
2023-05-27 22:25:52 +05:30
RSpec.describe Members::CreatorService, feature_category: :subgroups do
2022-06-21 17:19:12 +05:30
let_it_be(:source, reload: true) { create(:group, :public) }
let_it_be(:member_type) { GroupMember }
let_it_be(:user) { create(:user) }
let_it_be(:current_user) { create(:user) }
describe '#execute' do
it 'raises error for new member on authorization check implementation' do
expect do
2022-08-13 15:12:31 +05:30
described_class.add_member(source, user, :maintainer, current_user: current_user)
2022-06-21 17:19:12 +05:30
end.to raise_error(NotImplementedError)
end
it 'raises error for an existing member on authorization check implementation' do
source.add_developer(user)
expect do
2022-08-13 15:12:31 +05:30
described_class.add_member(source, user, :maintainer, current_user: current_user)
2022-06-21 17:19:12 +05:30
end.to raise_error(NotImplementedError)
end
end
end