Commit 87dac3d3 authored by Sean McGivern's avatar Sean McGivern

Merge branch '7846-fix-service-desk-emails' into 'master'

Move include to prepended block to fix service desk emails

Closes #7846

See merge request gitlab-org/gitlab-ee!7800
parents 8160cfe7 d594dae4
......@@ -3,10 +3,15 @@ module EE
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
# We need to put includes in prepended block due to the magical
# interaction between ActiveSupport::Concern and ActionMailer::Base
# See https://gitlab.com/gitlab-org/gitlab-ee/issues/7846
prepended do
include ::Emails::AdminNotification
include ::Emails::CsvExport
include ::Emails::ServiceDesk
include ::Emails::Epics
end
attr_reader :group
......
# frozen_string_literal: true
require 'spec_helper'
describe Emails::AdminNotification do
it 'adds email methods to Notify' do
subject.instance_methods.each do |email_method|
expect(Notify).to be_respond_to(email_method)
end
end
end
# frozen_string_literal: true
require 'spec_helper'
require 'email_spec'
......@@ -5,6 +7,12 @@ describe Emails::CsvExport do
include EmailSpec::Matchers
include_context 'gitlab email notification'
it 'adds email methods to Notify' do
subject.instance_methods.each do |email_method|
expect(Notify).to be_respond_to(email_method)
end
end
describe 'csv export email' do
let(:user) { create(:user) }
let(:empty_project) { create(:project, path: 'myproject') }
......
# frozen_string_literal: true
require 'spec_helper'
describe Emails::Epics do
it 'adds email methods to Notify' do
subject.instance_methods.each do |email_method|
expect(Notify).to be_respond_to(email_method)
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe Emails::ServiceDesk do
it 'adds email methods to Notify' do
subject.instance_methods.each do |email_method|
expect(Notify).to be_respond_to(email_method)
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