diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-17 02:30:02 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-17 02:30:02 +0300 |
commit | a0856cf7b94b76f5305f3dd49f6c2b2cc807ea99 (patch) | |
tree | a323ee9805c453369a53cc6ae99c59bc0fe4432a /spec/lib/bitbucket_server | |
parent | a6b7c4ee3134f7713b0b65848f3a511225cc3b59 (diff) |
Fix BitbucketServer::Client failing with Webmock 3.5.1
Webmock 3.1.0 changed the behavior to return `nil` for the body if an
HTTP 204 No Content response were received
(https://github.com/bblimke/webmock/commit/b837e642782501a6904d0cb1aad391dd6f49ada3).
Update the Bitbucket Server connection to ignore these No Content
response codes.
Diffstat (limited to 'spec/lib/bitbucket_server')
-rw-r--r-- | spec/lib/bitbucket_server/client_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/lib/bitbucket_server/client_spec.rb b/spec/lib/bitbucket_server/client_spec.rb index b021e69800a..4f0d57ca8a6 100644 --- a/spec/lib/bitbucket_server/client_spec.rb +++ b/spec/lib/bitbucket_server/client_spec.rb @@ -64,7 +64,7 @@ describe BitbucketServer::Client do let(:url) { "#{base_uri}rest/api/1.0/projects/SOME-PROJECT/repos/my-repo/branches" } it 'requests Bitbucket to create a branch' do - stub_request(:post, url).to_return(status: 204, headers: headers, body: '{}') + stub_request(:post, url).to_return(status: 204, headers: headers, body: nil) subject.create_branch(project, repo_slug, branch, sha) @@ -78,7 +78,7 @@ describe BitbucketServer::Client do let(:url) { "#{base_uri}rest/branch-utils/1.0/projects/SOME-PROJECT/repos/my-repo/branches" } it 'requests Bitbucket to create a branch' do - stub_request(:delete, url).to_return(status: 204, headers: headers, body: '{}') + stub_request(:delete, url).to_return(status: 204, headers: headers, body: nil) subject.delete_branch(project, repo_slug, branch, sha) |