diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-22 05:57:51 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-22 05:57:51 +0300 |
commit | 09008026f6ed5eebc94cbaaa8edf323c8aaad280 (patch) | |
tree | ee3cca889fea847530ffdd8d732daebe32b31bfb /spec | |
parent | f8986e4bb6dbeb1e340d5963e721136e7a01ea1d (diff) |
Move `ci_build_details_path` helper spec to correct location
Also, make it not fail.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/merge_request_helper_spec.rb | 22 | ||||
-rw-r--r-- | spec/helpers/merge_requests_helper_spec.rb | 20 |
2 files changed, 20 insertions, 22 deletions
diff --git a/spec/helpers/merge_request_helper_spec.rb b/spec/helpers/merge_request_helper_spec.rb deleted file mode 100644 index 5363511706e..00000000000 --- a/spec/helpers/merge_request_helper_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -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 diff --git a/spec/helpers/merge_requests_helper_spec.rb b/spec/helpers/merge_requests_helper_spec.rb index 28fb3216f60..600e1c4e9ec 100644 --- a/spec/helpers/merge_requests_helper_spec.rb +++ b/spec/helpers/merge_requests_helper_spec.rb @@ -1,6 +1,26 @@ require 'spec_helper' describe MergeRequestsHelper do + describe 'ci_build_details_path' do + let(:project) { create :project } + let(:merge_request) { MergeRequest.new } + let(:ci_service) { CiService.new } + let(:last_commit) { Ci::Commit.new({}) } + + before do + allow(merge_request).to receive(:source_project).and_return(project) + allow(merge_request).to receive(:last_commit).and_return(last_commit) + allow(project).to receive(:ci_service).and_return(ci_service) + allow(last_commit).to receive(:sha).and_return('12d65c') + end + + it 'does not include api credentials in a link' do + allow(ci_service). + to receive(:build_page).and_return("http://secretuser:secretpass@jenkins.example.com:8888/job/test1/scm/bySHA1/12d65c") + expect(helper.ci_build_details_path(merge_request)).to_not match("secret") + end + end + describe '#issues_sentence' do subject { issues_sentence(issues) } let(:issues) do |