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:
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/emails/in_product_marketing_spec.rb51
-rw-r--r--spec/mailers/emails/profile_spec.rb12
2 files changed, 10 insertions, 53 deletions
diff --git a/spec/mailers/emails/in_product_marketing_spec.rb b/spec/mailers/emails/in_product_marketing_spec.rb
deleted file mode 100644
index 93a06bfc881..00000000000
--- a/spec/mailers/emails/in_product_marketing_spec.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require 'email_spec'
-
-RSpec.describe Emails::InProductMarketing do
- include EmailSpec::Matchers
- include Gitlab::Routing.url_helpers
-
- let_it_be(:user) { create(:user) }
-
- shared_examples 'has custom headers when on gitlab.com' do
- context 'when on gitlab.com', :saas do
- it 'has custom headers' do
- aggregate_failures do
- expect(subject).to deliver_from(described_class::FROM_ADDRESS)
- expect(subject).to reply_to(described_class::FROM_ADDRESS)
- expect(subject).to have_header('X-Mailgun-Track', 'yes')
- expect(subject).to have_header('X-Mailgun-Track-Clicks', 'yes')
- expect(subject).to have_header('X-Mailgun-Track-Opens', 'yes')
- expect(subject).to have_header('X-Mailgun-Tag', 'marketing')
- expect(subject).to have_body_text('%tag_unsubscribe_url%')
- end
- end
- end
- end
-
- describe '#build_ios_app_guide_email' do
- subject { Notify.build_ios_app_guide_email(user.notification_email_or_default) }
-
- it 'sends to the right user' do
- expect(subject).to deliver_to(user.notification_email_or_default)
- end
-
- it 'has the correct subject and content' do
- message = Gitlab::Email::Message::BuildIosAppGuide.new
- cta_url = 'https://about.gitlab.com/blog/2019/03/06/ios-publishing-with-gitlab-and-fastlane/'
- cta2_url = 'https://www.youtube.com/watch?v=325FyJt7ZG8'
-
- aggregate_failures do
- is_expected.to have_subject(message.subject_line)
- is_expected.to have_body_text(message.title)
- is_expected.to have_body_text(message.body_line1)
- is_expected.to have_body_text(CGI.unescapeHTML(message.cta_link))
- is_expected.to have_body_text(CGI.unescapeHTML(message.cta2_link))
- is_expected.to have_body_text(cta_url)
- is_expected.to have_body_text(cta2_url)
- end
- end
- end
-end
diff --git a/spec/mailers/emails/profile_spec.rb b/spec/mailers/emails/profile_spec.rb
index 4816e88a311..7ddb4810d53 100644
--- a/spec/mailers/emails/profile_spec.rb
+++ b/spec/mailers/emails/profile_spec.rb
@@ -199,6 +199,10 @@ RSpec.describe Emails::Profile, feature_category: :user_profile do
it_behaves_like 'it should not have Gmail Actions links'
it_behaves_like 'a user cannot unsubscribe through footer link'
it_behaves_like 'resource about to expire email'
+
+ it 'includes the email reason' do
+ is_expected.to have_body_text _('You are receiving this email because you are an Owner of the Group.')
+ end
end
context 'when access token belongs to a project' do
@@ -218,6 +222,10 @@ RSpec.describe Emails::Profile, feature_category: :user_profile do
it_behaves_like 'it should not have Gmail Actions links'
it_behaves_like 'a user cannot unsubscribe through footer link'
it_behaves_like 'resource about to expire email'
+
+ it 'includes the email reason' do
+ is_expected.to have_body_text _('You are receiving this email because you are a Maintainer of the Project.')
+ end
end
end
@@ -289,7 +297,7 @@ RSpec.describe Emails::Profile, feature_category: :user_profile do
end
it 'has the correct subject' do
- is_expected.to have_subject /^A personal access token has been revoked$/i
+ is_expected.to have_subject /^Your personal access token has been revoked$/i
end
it 'provides the names of the token' do
@@ -317,7 +325,7 @@ RSpec.describe Emails::Profile, feature_category: :user_profile do
end
it 'has the correct subject' do
- is_expected.to have_subject /^A personal access token has been revoked$/i
+ is_expected.to have_subject /^Your personal access token has been revoked$/i
end
it 'provides the names of the token' do