Commit 7a155137 authored by Stan Hu's avatar Stan Hu

Fix spec for Bitbucket importer

parent fc40c3f2
...@@ -94,7 +94,7 @@ module Gitlab ...@@ -94,7 +94,7 @@ module Gitlab
import_pull_request_comments(pull_request, merge_request) if merge_request.persisted? import_pull_request_comments(pull_request, merge_request) if merge_request.persisted?
rescue ActiveRecord::RecordInvalid rescue ActiveRecord::RecordInvalid
nil Rails.log.error("Bitbucket importer ERROR in #{project.path_with_namespace}: Invalid pull request #{e.message}")
end end
end end
end end
...@@ -134,7 +134,7 @@ module Gitlab ...@@ -134,7 +134,7 @@ module Gitlab
merge_request.notes.create!(attributes) merge_request.notes.create!(attributes)
rescue ActiveRecord::RecordInvalid => e rescue ActiveRecord::RecordInvalid => e
Rails.log.error("Bitbucket importer ERROR: Invalid pull request comment #{e.message}") Rails.log.error("Bitbucket importer ERROR in #{project.path_with_namespace}: Invalid pull request comment #{e.message}")
nil nil
end end
end end
...@@ -145,7 +145,7 @@ module Gitlab ...@@ -145,7 +145,7 @@ module Gitlab
begin begin
merge_request.notes.create!(pull_request_comment_attributes(comment)) merge_request.notes.create!(pull_request_comment_attributes(comment))
rescue ActiveRecord::RecordInvalid => e rescue ActiveRecord::RecordInvalid => e
Rails.log.error("Bitbucket importer ERROR: Invalid standalone pull request comment #{e.message}") Rails.log.error("Bitbucket importer ERROR in #{project.path_with_namespace}: Invalid standalone pull request comment #{e.message}")
nil nil
end end
end end
......
...@@ -98,7 +98,7 @@ describe Gitlab::BitbucketImport::Importer, lib: true do ...@@ -98,7 +98,7 @@ describe Gitlab::BitbucketImport::Importer, lib: true do
it 'map statuses to open or closed' do it 'map statuses to open or closed' do
# HACK: Bitbucket::Representation.const_get('Issue') seems to return Issue without this # HACK: Bitbucket::Representation.const_get('Issue') seems to return Issue without this
Bitbucket::Representation::Issue.new Bitbucket::Representation::Issue.new({})
importer.execute importer.execute
expect(project.issues.where(state: "closed").size).to eq(5) expect(project.issues.where(state: "closed").size).to eq(5)
......
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