diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-12-01 21:22:24 +0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-12-02 19:35:01 +0300 |
commit | 3c767f06fa541587b0ade7ad6edbbe6e7f6b4470 (patch) | |
tree | 5c18cc120d9488c7b35c22b2752352d211463270 /spec | |
parent | 74a750d38e18ae85fd3830d0c41c540fdbc318cd (diff) |
Merge branch 'fix/github-importer' into 'master'
Fix GitHub importer to import PR where source repo/fork was renamed/deleted
Closes #24594
See merge request !7865
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/github_import/branch_formatter_spec.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/lib/gitlab/github_import/branch_formatter_spec.rb b/spec/lib/gitlab/github_import/branch_formatter_spec.rb index e5300dbba1e..462caa5b5fe 100644 --- a/spec/lib/gitlab/github_import/branch_formatter_spec.rb +++ b/spec/lib/gitlab/github_import/branch_formatter_spec.rb @@ -49,14 +49,20 @@ describe Gitlab::GithubImport::BranchFormatter, lib: true do end describe '#valid?' do - it 'returns true when raw repo is present' do + it 'returns true when raw sha and ref are present' do branch = described_class.new(project, double(raw)) expect(branch.valid?).to eq true end - it 'returns false when raw repo is blank' do - branch = described_class.new(project, double(raw.merge(repo: nil))) + it 'returns false when raw sha is blank' do + branch = described_class.new(project, double(raw.merge(sha: nil))) + + expect(branch.valid?).to eq false + end + + it 'returns false when raw ref is blank' do + branch = described_class.new(project, double(raw.merge(ref: nil))) expect(branch.valid?).to eq false end |