Commit ea6e4f65 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'ce-7287-epic-references' into 'master'

Support short reference to epics from project entities

See merge request gitlab-org/gitlab-ce!22048
parents aa836464 c0e9eb0e
......@@ -9,6 +9,12 @@ module Banzai
def self.object_class
Epic
end
private
def group
context[:group] || context[:project]&.group
end
end
end
end
......@@ -331,11 +331,12 @@ describe CacheMarkdownField do
end
context 'with a project' do
let(:thing) { thing_subclass(:project).new(foo: markdown, foo_html: html, project: :project_value) }
let(:project) { create(:project, group: create(:group)) }
let(:thing) { thing_subclass(:project).new(foo: markdown, foo_html: html, project: project) }
it 'sets the project in the context' do
is_expected.to have_key(:project)
expect(context[:project]).to eq(:project_value)
expect(context[:project]).to eq(project)
end
it 'invalidates the cache when project changes' do
......
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