diff options
author | Stan Hu <stanhu@gmail.com> | 2018-06-06 11:56:50 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-06-06 12:00:49 +0300 |
commit | 332275b766283ff65d0637ada3e4080c3cd4f038 (patch) | |
tree | 25ddd96287f3ea8eb26db54ea1d047acfa2a75ca /spec/support/controllers | |
parent | 3a722ff53fe86ce6194f81ade810196f4f8e870c (diff) |
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') |