Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/gitx/cli/integrate_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def integrate(integration_branch = 'staging')
pull_request = pull_request_for_branch(branch)
integrate_branch(branch, integration_branch, pull_request) unless options[:resume]
checkout_branch branch
create_integrate_comment(pull_request) if pull_request
end

private
Expand Down Expand Up @@ -89,11 +88,6 @@ def create_remote_branch(target_branch)
repo.create_branch(target_branch, Gitx::BASE_BRANCH)
run_cmd "git push origin #{target_branch}:#{target_branch}"
end

def create_integrate_comment(pull_request)
comment = '[gitx] integrated into staging :twisted_rightwards_arrows:'
github_client.add_comment(github_slug, pull_request.number, comment)
end
end
end
end
2 changes: 1 addition & 1 deletion lib/gitx/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Gitx
VERSION = '2.18.0'
VERSION = '2.19.0'
end
21 changes: 0 additions & 21 deletions spec/gitx/cli/integrate_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,13 @@
expect(cli).to receive(:run_cmd).with('git push origin HEAD').ordered
expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered

stub_request(:post, /.*api.github.com.*/).to_return(status: 201)

VCR.use_cassette('pull_request_does_exist_with_success_status') do
cli.integrate
end
end
it 'defaults to staging branch' do
should meet_expectations
end
it 'posts comment to pull request' do
expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments')
.with(body: { body: '[gitx] integrated into staging :twisted_rightwards_arrows:' })
end
end
context 'when current_branch == master' do
let(:current_branch) { double('fake branch', name: 'master', head?: true) }
Expand All @@ -71,9 +65,6 @@
it 'does not create pull request' do
expect(WebMock).to_not have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/pulls')
end
it 'does not post comment on pull request' do
expect(WebMock).to_not have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments')
end
end
context 'when a pull request doesnt exist for the feature-branch' do
let(:changelog) { '* made some fixes' }
Expand Down Expand Up @@ -101,7 +92,6 @@
expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered

stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(status: 201, body: new_pull_request.to_json, headers: { 'Content-Type' => 'application/json' })
stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments').to_return(status: 201)

VCR.use_cassette('pull_request_does_not_exist') do
cli.integrate
Expand All @@ -110,10 +100,6 @@
it 'creates github pull request' do
should meet_expectations
end
it 'creates github comment for integration' do
expect(WebMock).to have_requested(:post, 'https://api.github.com/repos/wireframe/gitx/issues/10/comments')
.with(body: { body: '[gitx] integrated into staging :twisted_rightwards_arrows:' })
end
it 'runs expected commands' do
should meet_expectations
end
Expand All @@ -134,8 +120,6 @@
expect(cli).to receive(:run_cmd).with('git push origin HEAD').ordered
expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered

stub_request(:post, /.*api.github.com.*/).to_return(status: 201)

VCR.use_cassette('pull_request_does_exist_with_success_status') do
cli.integrate
end
Expand All @@ -156,8 +140,6 @@
expect(cli).to receive(:run_cmd).with('git push origin HEAD').ordered
expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered

stub_request(:post, /.*api.github.com.*/).to_return(status: 201)

VCR.use_cassette('pull_request_does_exist_with_success_status') do
cli.integrate 'prototype'
end
Expand Down Expand Up @@ -214,8 +196,6 @@
expect(cli).not_to receive(:run_cmd).with('git push origin HEAD')
expect(cli).to receive(:run_cmd).with('git checkout feature-branch')

stub_request(:post, /.*api.github.com.*/).to_return(status: 201)

VCR.use_cassette('pull_request_does_exist_with_success_status') do
cli.integrate
end
Expand All @@ -239,7 +219,6 @@
expect(cli).not_to receive(:run_cmd).with('git push origin HEAD')
expect(cli).to receive(:run_cmd).with('git checkout feature-branch').ordered

stub_request(:post, /.*api.github.com.*/).to_return(status: 201)
VCR.use_cassette('pull_request_does_exist_with_success_status') do
cli.integrate
end
Expand Down