diff options
author | Stan Hu <stanhu@gmail.com> | 2018-06-06 01:56:50 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-06-06 02:00:49 -0700 |
commit | 332275b766283ff65d0637ada3e4080c3cd4f038 (patch) | |
tree | 25ddd96287f3ea8eb26db54ea1d047acfa2a75ca /spec/support/controllers | |
parent | 3a722ff53fe86ce6194f81ade810196f4f8e870c (diff) | |
download | gitlab-ce-332275b766283ff65d0637ada3e4080c3cd4f038.tar.gz |
Simplify error message handling in Projects::CreateService
There's no need to add a redundant message to the errors if the
model is invalid. This cleans up the message as well for the importer.
Diffstat (limited to 'spec/support/controllers')
-rw-r--r-- | spec/support/controllers/githubish_import_controller_shared_examples.rb | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/spec/support/controllers/githubish_import_controller_shared_examples.rb b/spec/support/controllers/githubish_import_controller_shared_examples.rb index 1a53c5fa487..1c1b68c12a2 100644 --- a/spec/support/controllers/githubish_import_controller_shared_examples.rb +++ b/spec/support/controllers/githubish_import_controller_shared_examples.rb @@ -120,21 +120,6 @@ shared_examples 'a GitHub-ish import controller: POST create' do it 'returns 422 response with the base error when the project could not be imported' do project = build(:project) - error_message = 'This is an error' - project.errors.add(:base, error_message) - - allow(Gitlab::LegacyGithubImport::ProjectCreator) - .to receive(:new).with(provider_repo, provider_repo.name, user.namespace, user, access_params, type: provider) - .and_return(double(execute: project)) - - post :create, format: :json - - expect(response).to have_gitlab_http_status(422) - expect(json_response['errors']).to eq(error_message) - end - - it 'returns 422 response with a combined error when the project could not be imported' do - project = build(:project) project.errors.add(:name, 'is invalid') project.errors.add(:path, 'is old') |