summaryrefslogtreecommitdiff
path: root/lib/gitlab/github_import
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-18 06:26:16 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:28 -0200
commitf0ad0ceff5236f3ee5babee47bfec217a54c3b07 (patch)
tree40640e4204f01b732827dd29769dd8977eeb3001 /lib/gitlab/github_import
parent1a41a89cb383d286e21a125e8a643eb0fbb2442b (diff)
downloadgitlab-ce-f0ad0ceff5236f3ee5babee47bfec217a54c3b07.tar.gz
Fix GitHub importer spec
Diffstat (limited to 'lib/gitlab/github_import')
-rw-r--r--lib/gitlab/github_import/label_formatter.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/github_import/label_formatter.rb b/lib/gitlab/github_import/label_formatter.rb
index 3101116a614..8ed1574c4fc 100644
--- a/lib/gitlab/github_import/label_formatter.rb
+++ b/lib/gitlab/github_import/label_formatter.rb
@@ -16,8 +16,11 @@ module Gitlab
def create!
params = attributes.except(:project)
service = ::Labels::CreateService.new(project.owner, project, params)
+ label = service.execute
- service.execute
+ raise ActiveRecord::RecordInvalid.new(label) unless label.persisted?
+
+ label
end
private