Commit 5848160c authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'fix_project_creator_spec_keyword_args' into 'master'

Fix depreciation warning for positional args for project creator spec

See merge request gitlab-org/gitlab!48809
parents deb0d988 f2628cc7
...@@ -31,9 +31,8 @@ module Import ...@@ -31,9 +31,8 @@ module Import
project_name, project_name,
target_namespace, target_namespace,
current_user, current_user,
access_params, type: provider,
type: provider **access_params).execute(extra_project_attrs)
).execute(extra_project_attrs)
end end
def repo def repo
......
...@@ -5,7 +5,7 @@ module Gitlab ...@@ -5,7 +5,7 @@ module Gitlab
class ProjectCreator class ProjectCreator
attr_reader :repo, :name, :namespace, :current_user, :session_data, :type attr_reader :repo, :name, :namespace, :current_user, :session_data, :type
def initialize(repo, name, namespace, current_user, session_data, type: 'github') def initialize(repo, name, namespace, current_user, type: 'github', **session_data)
@repo = repo @repo = repo
@name = name @name = name
@namespace = namespace @namespace = namespace
......
...@@ -44,7 +44,7 @@ RSpec.describe API::ImportGithub do ...@@ -44,7 +44,7 @@ RSpec.describe API::ImportGithub do
it 'returns 201 response when the project is imported successfully' do it 'returns 201 response when the project is imported successfully' do
allow(Gitlab::LegacyGithubImport::ProjectCreator) allow(Gitlab::LegacyGithubImport::ProjectCreator)
.to receive(:new).with(provider_repo, provider_repo.name, user.namespace, user, access_params, type: provider) .to receive(:new).with(provider_repo, provider_repo.name, user.namespace, user, type: provider, **access_params)
.and_return(double(execute: project)) .and_return(double(execute: project))
post api("/import/github", user), params: { post api("/import/github", user), params: {
...@@ -59,7 +59,7 @@ RSpec.describe API::ImportGithub do ...@@ -59,7 +59,7 @@ RSpec.describe API::ImportGithub do
it 'returns 201 response when the project is imported successfully from GHE' do it 'returns 201 response when the project is imported successfully from GHE' do
allow(Gitlab::LegacyGithubImport::ProjectCreator) allow(Gitlab::LegacyGithubImport::ProjectCreator)
.to receive(:new).with(provider_repo, provider_repo.name, user.namespace, user, access_params, type: provider) .to receive(:new).with(provider_repo, provider_repo.name, user.namespace, user, type: provider, **access_params)
.and_return(double(execute: project)) .and_return(double(execute: project))
post api("/import/github", user), params: { post api("/import/github", user), params: {
......
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