Fix GitHub importer spec

parent 1a41a89c
...@@ -16,8 +16,11 @@ module Gitlab ...@@ -16,8 +16,11 @@ module Gitlab
def create! def create!
params = attributes.except(:project) params = attributes.except(:project)
service = ::Labels::CreateService.new(project.owner, project, params) service = ::Labels::CreateService.new(project.owner, project, params)
label = service.execute
service.execute raise ActiveRecord::RecordInvalid.new(label) unless label.persisted?
label
end end
private private
......
...@@ -157,7 +157,7 @@ describe Gitlab::GithubImport::Importer, lib: true do ...@@ -157,7 +157,7 @@ describe Gitlab::GithubImport::Importer, lib: true do
{ type: :pull_request, url: "https://api.github.com/repos/octocat/Hello-World/pulls/1347", errors: "Validation failed: Validate branches Cannot Create: This merge request already exists: [\"New feature\"]" }, { type: :pull_request, url: "https://api.github.com/repos/octocat/Hello-World/pulls/1347", errors: "Validation failed: Validate branches Cannot Create: This merge request already exists: [\"New feature\"]" },
{ type: :wiki, errors: "Gitlab::Shell::Error" }, { type: :wiki, errors: "Gitlab::Shell::Error" },
{ type: :release, url: 'https://api.github.com/repos/octocat/Hello-World/releases/2', errors: "Validation failed: Description can't be blank" } { type: :release, url: 'https://api.github.com/repos/octocat/Hello-World/releases/2', errors: "Validation failed: Description can't be blank" }
] ]
} }
described_class.new(project).execute described_class.new(project).execute
......
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