From ae6b48d20fe559a354ffd27bb07e4e09be2382da Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 28 Jul 2018 17:09:10 -0700 Subject: [PATCH] Fix failing spec in spec/lib/bitbucket_server/client_spec.rb --- spec/lib/bitbucket_server/client_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/lib/bitbucket_server/client_spec.rb b/spec/lib/bitbucket_server/client_spec.rb index d9e0a0677b2..d7931d6e4b5 100644 --- a/spec/lib/bitbucket_server/client_spec.rb +++ b/spec/lib/bitbucket_server/client_spec.rb @@ -4,6 +4,7 @@ describe BitbucketServer::Client do let(:options) { { base_uri: 'https://test:7990', user: 'bitbucket', password: 'mypassword' } } let(:project) { 'SOME-PROJECT' } let(:repo_slug) { 'my-repo' } + let(:headers) { { "Content-Type" => "application/json" } } subject { described_class.new(options) } @@ -38,7 +39,7 @@ describe BitbucketServer::Client do let(:url) { "https://test:7990/rest/api/1.0/projects/SOME-PROJECT/repos/my-repo" } it 'requests a specific repository' do - stub_request(:get, url) + stub_request(:get, url).to_return(status: 200, headers: headers, body: '{}') subject.repo(project, repo_slug) @@ -62,7 +63,7 @@ describe BitbucketServer::Client do let(:url) { 'https://test:7990/rest/api/1.0/projects/SOME-PROJECT/repos/my-repo/branches' } it 'requests Bitbucket to create a branch' do - stub_request(:post, url) + stub_request(:post, url).to_return(status: 204, headers: headers, body: '{}') subject.create_branch(project, repo_slug, branch, sha) @@ -76,7 +77,7 @@ describe BitbucketServer::Client do let(:url) { 'https://test:7990/rest/branch-utils/1.0/projects/SOME-PROJECT/repos/my-repo/branches' } it 'requests Bitbucket to create a branch' do - stub_request(:delete, url) + stub_request(:delete, url).to_return(status: 204, headers: headers, body: '{}') subject.delete_branch(project, repo_slug, branch, sha)