Commit f6417b82 authored by Toon Claes's avatar Toon Claes

Include link to raw job log in plain-text emails

People who prefer plain text email also might prefer the raw job log
files. So include the link directly to there.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56849
parent 38da5d6b
Job #<%= build.id %> ( <%= pipeline_job_url(pipeline, build) %> ) Job #<%= build.id %> ( <%= raw_project_job_url(pipeline.project, build) %> )
---
title: Include link to raw job log in plain-text emails
merge_request: 27409
author:
type: changed
# frozen_string_literal: true
require 'spec_helper'
describe 'notify/pipeline_failed_email.text.erb' do
include Devise::Test::ControllerHelpers
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, :simple, source_project: project) }
let(:pipeline) do
create(:ci_pipeline,
:failed,
project: project,
user: user,
ref: project.default_branch,
sha: project.commit.sha)
end
before do
assign(:project, project)
assign(:pipeline, pipeline)
assign(:merge_request, merge_request)
end
it 'renders the email correctly' do
job = create(:ci_build, :failed, pipeline: pipeline, project: pipeline.project)
render
expect(rendered).to have_content('Your pipeline has failed')
expect(rendered).to have_content(pipeline.project.name)
expect(rendered).to have_content(pipeline.git_commit_message.truncate(50))
expect(rendered).to have_content(pipeline.commit.author_name)
expect(rendered).to have_content("##{pipeline.id}")
expect(rendered).to have_content(pipeline.user.name)
expect(rendered).to have_content("/-/jobs/#{job.id}/raw")
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment