Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-22 15:14:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-22 15:14:34 +0300
commit26fa51816ab94df9c2f3db8c93da4d57f7bd6fc4 (patch)
tree3b29671cb4bc910500d8c7db4e2694b4c012387e /spec/models/member_spec.rb
parent6b0293c14dce817f72310127dd38562313321b1b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/member_spec.rb')
-rw-r--r--spec/models/member_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb
index db2ae319bc9..32303f76684 100644
--- a/spec/models/member_spec.rb
+++ b/spec/models/member_spec.rb
@@ -735,6 +735,30 @@ RSpec.describe Member, feature_category: :groups_and_projects do
it { is_expected.to respond_to(:user_email) }
end
+ describe 'callbacks' do
+ describe '#send_invite' do
+ context 'with an invited group member' do
+ it 'sends an invite email' do
+ expect_next_instance_of(NotificationService) do |instance|
+ expect(instance).to receive(:invite_member)
+ end
+
+ create(:group_member, :invited)
+ end
+ end
+
+ context 'with an uninvited member' do
+ it 'does not send an invite email' do
+ expect_next_instance_of(NotificationService) do |instance|
+ expect(instance).not_to receive(:invite_member)
+ end
+
+ create(:group_member)
+ end
+ end
+ end
+ end
+
describe '.valid_email?' do
it 'is a valid email format' do
expect(described_class.valid_email?('foo')).to eq(false)