Commit f4959a0f authored by Kerri Miller's avatar Kerri Miller

Merge branch 'id-show-base-diff-for-merged-mrs' into 'master'

Display base diff for merged merge requests

See merge request gitlab-org/gitlab!48691
parents 11f30d8c f5e24b32
......@@ -972,7 +972,7 @@ class MergeRequest < ApplicationRecord
# rubocop: enable CodeReuse/ServiceClass
def diffable_merge_ref?
merge_ref_head.present? && (Feature.enabled?(:display_merge_conflicts_in_diff, project) || can_be_merged?)
open? && merge_ref_head.present? && (Feature.enabled?(:display_merge_conflicts_in_diff, project) || can_be_merged?)
end
# Returns boolean indicating the merge_status should be rechecked in order to
......
......@@ -4275,6 +4275,14 @@ RSpec.describe MergeRequest, factory_default: :keep do
expect(subject.diffable_merge_ref?).to eq(true)
end
context 'merge request is merged' do
subject { build_stubbed(:merge_request, :merged, project: project) }
it 'returns false' do
expect(subject.diffable_merge_ref?).to eq(false)
end
end
context 'merge request cannot be merged' do
before do
subject.mark_as_unchecked!
......
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