diff options
Diffstat (limited to 'spec/mailers')
-rw-r--r-- | spec/mailers/emails/merge_requests_spec.rb | 15 | ||||
-rw-r--r-- | spec/mailers/emails/pipelines_spec.rb | 18 | ||||
-rw-r--r-- | spec/mailers/notify_spec.rb | 60 |
3 files changed, 58 insertions, 35 deletions
diff --git a/spec/mailers/emails/merge_requests_spec.rb b/spec/mailers/emails/merge_requests_spec.rb index 7682cf39450..9aece9538dc 100644 --- a/spec/mailers/emails/merge_requests_spec.rb +++ b/spec/mailers/emails/merge_requests_spec.rb @@ -13,12 +13,15 @@ RSpec.describe Emails::MergeRequests do let_it_be(:reviewer, reload: true) { create(:user, email: 'reviewer@example.com', name: 'Jane Doe') } let_it_be(:project) { create(:project, :repository) } let_it_be(:merge_request) do - create(:merge_request, source_project: project, - target_project: project, - author: current_user, - assignees: [assignee], - reviewers: [reviewer], - description: 'Awesome description') + create( + :merge_request, + source_project: project, + target_project: project, + author: current_user, + assignees: [assignee], + reviewers: [reviewer], + description: 'Awesome description' + ) end let(:recipient) { assignee } diff --git a/spec/mailers/emails/pipelines_spec.rb b/spec/mailers/emails/pipelines_spec.rb index 1ac989cc46b..ae0876338f5 100644 --- a/spec/mailers/emails/pipelines_spec.rb +++ b/spec/mailers/emails/pipelines_spec.rb @@ -25,8 +25,13 @@ RSpec.describe Emails::Pipelines do let(:pipeline) { create(:ci_pipeline, ref: 'master', sha: sha, project: project) } let!(:merge_request) do - create(:merge_request, source_branch: 'master', target_branch: 'feature', - source_project: project, target_project: project) + create( + :merge_request, + source_branch: 'master', + target_branch: 'feature', + source_project: project, + target_project: project + ) end it 'has correct information that there is no merge request link' do @@ -55,8 +60,13 @@ RSpec.describe Emails::Pipelines do context 'when branch pipeline is set to a merge request as a head pipeline' do let(:pipeline) do - create(:ci_pipeline, project: project, ref: ref, sha: sha, - merge_requests_as_head_pipeline: [merge_request]) + create( + :ci_pipeline, + project: project, + ref: ref, + sha: sha, + merge_requests_as_head_pipeline: [merge_request] + ) end let(:merge_request) do diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index eb681846e82..c2c32abbdc4 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -21,19 +21,25 @@ RSpec.describe Notify do let_it_be(:reviewer, reload: true) { create(:user, email: 'reviewer@example.com', name: 'Jane Doe') } let_it_be(:merge_request) do - create(:merge_request, source_project: project, - target_project: project, - author: current_user, - assignees: [assignee], - reviewers: [reviewer], - description: 'Awesome description') + create( + :merge_request, + source_project: project, + target_project: project, + author: current_user, + assignees: [assignee], + reviewers: [reviewer], + description: 'Awesome description' + ) end let_it_be(:issue, reload: true) do - create(:issue, author: current_user, - assignees: [assignee], - project: project, - description: 'My awesome description!') + create( + :issue, + author: current_user, + assignees: [assignee], + project: project, + description: 'My awesome description!' + ) end describe 'with HTML-encoded entities' do @@ -824,9 +830,11 @@ RSpec.describe Notify do end it 'has References header including the notes and issue of the discussion' do - expect(subject.header['References'].message_ids).to include("issue_#{first_note.noteable.id}@#{host}", - "note_#{first_note.id}@#{host}", - "note_#{second_note.id}@#{host}") + expect(subject.header['References'].message_ids).to include( + "issue_#{first_note.noteable.id}@#{host}", + "note_#{first_note.id}@#{host}", + "note_#{second_note.id}@#{host}" + ) end it 'has X-GitLab-Discussion-ID header' do @@ -899,9 +907,11 @@ RSpec.describe Notify do end it 'links to the project snippet' do - target_url = project_snippet_url(project, - project_snippet_note.noteable, - { anchor: "note_#{project_snippet_note.id}" }) + target_url = project_snippet_url( + project, + project_snippet_note.noteable, + { anchor: "note_#{project_snippet_note.id}" } + ) is_expected.to have_body_text target_url end end @@ -910,9 +920,7 @@ RSpec.describe Notify do let_it_be(:design) { create(:design, :with_file) } let_it_be(:recipient) { create(:user) } let_it_be(:note) do - create(:diff_note_on_design, - noteable: design, - note: "Hello #{recipient.to_reference}") + create(:diff_note_on_design, noteable: design, note: "Hello #{recipient.to_reference}") end let(:header_name) { 'X-Gitlab-DesignManagement-Design-ID' } @@ -1078,9 +1086,10 @@ RSpec.describe Notify do is_expected.to have_body_text project.full_name is_expected.to have_body_text project_member.human_access.downcase is_expected.to have_body_text project_member.invite_token - is_expected.to have_link('Join now', - href: invite_url(project_member.invite_token, - invite_type: Emails::Members::INITIAL_INVITE)) + is_expected.to have_link( + 'Join now', + href: invite_url(project_member.invite_token, invite_type: Emails::Members::INITIAL_INVITE) + ) is_expected.to have_content("#{inviter.name} invited you to join the") is_expected.to have_content('Project details') is_expected.to have_content("What's it about?") @@ -1096,9 +1105,10 @@ RSpec.describe Notify do is_expected.to have_body_text project.full_name is_expected.to have_body_text project_member.human_access.downcase is_expected.to have_body_text project_member.invite_token - is_expected.to have_link('Join now', - href: invite_url(project_member.invite_token, - invite_type: Emails::Members::INITIAL_INVITE)) + is_expected.to have_link( + 'Join now', + href: invite_url(project_member.invite_token, invite_type: Emails::Members::INITIAL_INVITE) + ) is_expected.to have_content('Project details') is_expected.to have_content("What's it about?") end |