diff options
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/devise_mailer_spec.rb | 18 | ||||
-rw-r--r-- | spec/mailers/previews_spec.rb | 1 |
2 files changed, 17 insertions, 2 deletions
diff --git a/spec/mailers/devise_mailer_spec.rb b/spec/mailers/devise_mailer_spec.rb index 171251f51ef..23ad20f3ad6 100644 --- a/spec/mailers/devise_mailer_spec.rb +++ b/spec/mailers/devise_mailer_spec.rb @@ -150,10 +150,12 @@ RSpec.describe DeviseMailer do end describe '#email_changed' do - subject { described_class.email_changed(user, {}) } - + let(:content_saas) { 'If you did not initiate this change, please contact your group owner immediately. If you have a Premium or Ultimate tier subscription, you can also contact GitLab support.' } + let(:content_self_managed) { 'If you did not initiate this change, please contact your administrator immediately.' } let_it_be(:user) { create(:user) } + subject { described_class.email_changed(user, {}) } + it_behaves_like 'an email sent from GitLab' it 'is sent to the user' do @@ -168,6 +170,18 @@ RSpec.describe DeviseMailer do is_expected.to have_body_text /Hello, #{user.name}!/ end + context 'when self-managed' do + it 'has the expected content of self managed instance' do + is_expected.to have_body_text content_self_managed + end + end + + context 'when saas', :saas do + it 'has the expected content of saas instance' do + is_expected.to have_body_text content_saas + end + end + context "email contains updated id" do before do user.update!(email: "new_email@test.com") diff --git a/spec/mailers/previews_spec.rb b/spec/mailers/previews_spec.rb index 14bd56e5d40..e1af0d7ef77 100644 --- a/spec/mailers/previews_spec.rb +++ b/spec/mailers/previews_spec.rb @@ -13,6 +13,7 @@ RSpec.describe 'Mailer previews' do let_it_be(:issue) { create(:issue, project: project, milestone: milestone) } let_it_be(:remote_mirror) { create(:remote_mirror, project: project) } let_it_be(:member) { create(:project_member, :maintainer, project: project, created_by: user) } + let_it_be(:review) { create(:review, project: project, merge_request: merge_request, author: user) } Gitlab.ee do let_it_be(:epic) { create(:epic, group: group) } |