diff options
author | Marvin Frick <marvin.frick@sinnerschrader.com> | 2014-06-10 21:21:28 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-22 00:28:19 +0100 |
commit | 0d05400bdee182de0564e4b0ac85f9365aa76adb (patch) | |
tree | f9705b319f0fd5e31daec2b6a42f19d978c1f0c3 /spec | |
parent | 4156a37aecb83155752d84f44f800dcffb61741e (diff) | |
download | gitlab-ce-0d05400bdee182de0564e4b0ac85f9365aa76adb.tar.gz |
removes api credentials from link to build_page
Also adds a spec for MergeRequestHelper to avoid having a regression
later on.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/merge_request_helper_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/helpers/merge_request_helper_spec.rb b/spec/helpers/merge_request_helper_spec.rb new file mode 100644 index 00000000000..5363511706e --- /dev/null +++ b/spec/helpers/merge_request_helper_spec.rb @@ -0,0 +1,22 @@ +require "spec_helper" + +describe MergeRequestsHelper do + let(:project) { create :project } + let(:merge_request) { MergeRequest.new } + let(:ci_service) { CiService.new } + let(:last_commit) { Commit.new({}) } + + before do + merge_request.stub(:source_project) { project } + merge_request.stub(:last_commit) { last_commit } + project.stub(:ci_service) { ci_service } + last_commit.stub(:sha) { '12d65c' } + end + + describe :ci_build_details_path do + it 'does not include api credentials in a link' do + ci_service.stub(:build_page) { "http://secretuser:secretpass@jenkins.example.com:8888/job/test1/scm/bySHA1/12d65c" } + expect(ci_build_details_path(merge_request)).to_not match("secret") + end + end +end
\ No newline at end of file |