Commit c76a3041 authored by Illya Klymov's avatar Illya Klymov

Merge branch...

Merge branch '220038-actionview-template-error-undefined-method-namespace_url-for-class-0x00007f7175d31678' into 'master'

Specify group url in notification email

Closes #220038

See merge request gitlab-org/gitlab!33613
parents ffcf4735 30e3fbfc
%p %p
- name_link = link_to @namespace.name, @namespace - name_link = link_to @namespace.name, group_url(@namespace)
= html_escape(_('%{name_with_link} has run out of Shared Runner Pipeline minutes so no new jobs or pipelines in its projects will run.')) % { name_with_link: name_link.html_safe } = html_escape(_('%{name_with_link} has run out of Shared Runner Pipeline minutes so no new jobs or pipelines in its projects will run.')) % { name_with_link: name_link.html_safe }
%p %p
= _('We recommend that you buy more Pipeline minutes to resume normal service.') = _('We recommend that you buy more Pipeline minutes to resume normal service.')
......
%p %p
- name_link = link_to @namespace.name, @namespace - name_link = link_to @namespace.name, group_url(@namespace)
= html_escape(_('%{name_with_link} has %{percent} or less Shared Runner Pipeline minutes remaining. Once it runs out, no new jobs or pipelines in its projects will run.')) % { name_with_link: name_link.html_safe, percent: "#{@percentage_of_available_mins}%" } = html_escape(_('%{name_with_link} has %{percent} or less Shared Runner Pipeline minutes remaining. Once it runs out, no new jobs or pipelines in its projects will run.')) % { name_with_link: name_link.html_safe, percent: "#{@percentage_of_available_mins}%" }
%p %p
= _('We recommend that you buy more Pipeline minutes to avoid any interruption of service.') = _('We recommend that you buy more Pipeline minutes to avoid any interruption of service.')
......
---
title: Specify group url in notification email
merge_request: 33613
author:
type: fixed
...@@ -16,27 +16,43 @@ RSpec.describe CiMinutesUsageMailer do ...@@ -16,27 +16,43 @@ RSpec.describe CiMinutesUsageMailer do
end end
describe '#notify' do describe '#notify' do
it_behaves_like 'mail format' do let(:subject_text) do
let(:subject_text) do "Action required: There are no remaining Pipeline minutes for #{namespace.name}"
"Action required: There are no remaining Pipeline minutes for #{namespace.name}" end
end
let(:body_text) { "has run out of Shared Runner Pipeline minutes" }
let(:body_text) { "has run out of Shared Runner Pipeline minutes" } subject { described_class.notify(namespace, recipients) }
subject { described_class.notify(namespace, recipients) } context 'when it is a group' do
it_behaves_like 'mail format'
end
context 'when it is a namespace' do
it_behaves_like 'mail format' do
let(:namespace) { create(:namespace) }
end
end end
end end
describe '#notify_limit' do describe '#notify_limit' do
it_behaves_like 'mail format' do let(:percent) { 30 }
let(:percent) { 30 } let(:subject_text) do
let(:subject_text) do "Action required: Less than #{percent}% of Pipeline minutes remain for #{namespace.name}"
"Action required: Less than #{percent}% of Pipeline minutes remain for #{namespace.name}" end
end
let(:body_text) { "has #{percent}% or less Shared Runner Pipeline minutes" }
let(:body_text) { "has #{percent}% or less Shared Runner Pipeline minutes" } subject { described_class.notify_limit(namespace, recipients, percent) }
subject { described_class.notify_limit(namespace, recipients, percent) } context 'when it is a group' do
it_behaves_like 'mail format'
end
context 'when it is a namespace' do
it_behaves_like 'mail format' do
let(:namespace) { create(:namespace) }
end
end end
end end
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