Commit ee0e02f5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'sh-bitbucket-importer-handle-superseded' into 'master'

Make Bitbucket Cloud superseded pull requests as closed

See merge request gitlab-org/gitlab!19193
parents dc0da798 148b23e3
---
title: Make Bitbucket Cloud superseded pull requests as closed
merge_request: 19193
author:
type: fixed
...@@ -16,9 +16,10 @@ module Bitbucket ...@@ -16,9 +16,10 @@ module Bitbucket
end end
def state def state
if raw['state'] == 'MERGED' case raw['state']
when 'MERGED'
'merged' 'merged'
elsif raw['state'] == 'DECLINED' when 'DECLINED', 'SUPERSEDED'
'closed' 'closed'
else else
'opened' 'opened'
......
...@@ -20,6 +20,7 @@ describe Bitbucket::Representation::PullRequest do ...@@ -20,6 +20,7 @@ describe Bitbucket::Representation::PullRequest do
describe '#state' do describe '#state' do
it { expect(described_class.new({ 'state' => 'MERGED' }).state).to eq('merged') } it { expect(described_class.new({ 'state' => 'MERGED' }).state).to eq('merged') }
it { expect(described_class.new({ 'state' => 'DECLINED' }).state).to eq('closed') } it { expect(described_class.new({ 'state' => 'DECLINED' }).state).to eq('closed') }
it { expect(described_class.new({ 'state' => 'SUPERSEDED' }).state).to eq('closed') }
it { expect(described_class.new({}).state).to eq('opened') } it { expect(described_class.new({}).state).to eq('opened') }
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment