summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2017-07-10 14:54:58 -0500
committerClement Ho <ClemMakesApps@gmail.com>2017-07-10 14:55:13 -0500
commit9e4e1afb4a7907f2a79d18fd9b5d03c9f6599ccf (patch)
treebd6d51d626578380031f6c0b65f231a6e0acdc71 /spec
parent31ada792621f17ab7f4f7475405ddd1ec9e9673a (diff)
downloadgitlab-ce-9e4e1afb4a7907f2a79d18fd9b5d03c9f6599ccf.tar.gz
MR branch link now links to tree instead of commits
Diffstat (limited to 'spec')
-rw-r--r--spec/presenters/merge_request_presenter_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/presenters/merge_request_presenter_spec.rb b/spec/presenters/merge_request_presenter_spec.rb
index f5a14b1d04d..40fe9e3c004 100644
--- a/spec/presenters/merge_request_presenter_spec.rb
+++ b/spec/presenters/merge_request_presenter_spec.rb
@@ -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