MR branch link now links to tree instead of commits

This commit is contained in:
Clement Ho 2017-07-10 14:54:58 -05:00
parent 31ada79262
commit 9e4e1afb4a
3 changed files with 18 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
if source_branch_exists?
namespace = link_to(namespace, project_path(source_project))
branch = link_to(branch, project_commits_path(source_project, source_branch))
branch = link_to(branch, project_tree_path(source_project, source_branch))
end
if for_fork?

View File

@ -0,0 +1,4 @@
---
title: MR branch link now links to tree instead of commits
merge_request:
author:

View File

@ -363,4 +363,17 @@ describe MergeRequestPresenter do
end
end
end
describe '#source_branch_with_namespace_link' do
subject do
described_class.new(resource, current_user: user).source_branch_with_namespace_link
end
it 'returns link' do
allow(resource).to receive(:source_branch_exists?) { true }
is_expected
.to eq("<a href=\"/#{resource.source_project.full_path}/tree/#{resource.source_branch}\">#{resource.source_branch}</a>")
end
end
end