diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-08-27 12:04:27 +0300 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-08-27 14:25:22 +0300 |
commit | 1ee8d6385d8cb00ed3487dd7b02874e0279b78f6 (patch) | |
tree | 9f2b52a14663862283d05150aa43a7a09018453c /spec/models | |
parent | a390f5ff052cfb9d214acbf1f4e78a830ba0e67b (diff) |
Use `stub_full_request` to fix spec failure
Also change test URL sequest to .test TLD
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 78be4a8131a..7d84d094bdf 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -4,6 +4,7 @@ require 'spec_helper' describe Ci::Pipeline, :mailer do include ProjectForksHelper + include StubRequests let(:user) { create(:user) } set(:project) { create(:project) } @@ -2504,7 +2505,7 @@ describe Ci::Pipeline, :mailer do let(:enabled) { true } before do - WebMock.stub_request(:post, hook.url) + stub_full_request(hook.url, method: :post) end context 'with multiple builds' do @@ -2558,7 +2559,7 @@ describe Ci::Pipeline, :mailer do end def have_requested_pipeline_hook(status) - have_requested(:post, hook.url).with do |req| + have_requested(:post, stubbed_hostname(hook.url)).with do |req| json_body = JSON.parse(req.body) json_body['object_attributes']['status'] == status && json_body['builds'].length == 2 |