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-04-06 21:08:40 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-06 21:08:40 +0300
commit1f5e09ed6082d079dfebef92f69630c10f78c844 (patch)
tree5ef925fe6d08f2a042e47c2a9e1c40238ca8211c /spec/mailers
parent78782cd1eb5273265668ca3e438bb8cbb1344004 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/emails/profile_spec.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/mailers/emails/profile_spec.rb b/spec/mailers/emails/profile_spec.rb
index c796801fdf9..140b067f7aa 100644
--- a/spec/mailers/emails/profile_spec.rb
+++ b/spec/mailers/emails/profile_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
require 'email_spec'
-RSpec.describe Emails::Profile do
+RSpec.describe Emails::Profile, feature_category: :user_profile do
include EmailSpec::Matchers
include_context 'gitlab email notification'
@@ -541,4 +541,31 @@ RSpec.describe Emails::Profile do
is_expected.to have_body_text /#{profile_emails_path}/
end
end
+
+ describe 'awarded a new achievement' do
+ let(:user) { build(:user) }
+ let(:achievement) { build(:achievement) }
+
+ subject { Notify.new_achievement_email(user, achievement) }
+
+ it_behaves_like 'an email sent from GitLab'
+ it_behaves_like 'it should not have Gmail Actions links'
+ it_behaves_like 'a user cannot unsubscribe through footer link'
+
+ it 'is sent to the user' do
+ is_expected.to deliver_to user.email
+ end
+
+ it 'has the correct subject' do
+ is_expected.to have_subject("#{achievement.namespace.full_path} awarded you the #{achievement.name} achievement")
+ end
+
+ it 'includes a link to the profile page' do
+ is_expected.to have_body_text(group_url(achievement.namespace))
+ end
+
+ it 'includes a link to the awarding group' do
+ is_expected.to have_body_text(user_url(user))
+ end
+ end
end