Commit 4ac4918b authored by Matthias Käppler's avatar Matthias Käppler

Merge branch '330844-terraform-module-enumeration' into 'master'

Fixes message for 403 creating a Terraform Module package

See merge request gitlab-org/gitlab!77918
parents d62ccc1e d1e57b99
...@@ -7,7 +7,7 @@ module Packages ...@@ -7,7 +7,7 @@ module Packages
def execute def execute
return error('Version is empty.', 400) if params[:module_version].blank? return error('Version is empty.', 400) if params[:module_version].blank?
return error('Package already exists.', 403) if current_package_exists_elsewhere? return error('Access Denied', 403) if current_package_exists_elsewhere?
return error('Package version already exists.', 403) if current_package_version_exists? return error('Package version already exists.', 403) if current_package_version_exists?
return error('File is too large.', 400) if file_size_exceeded? return error('File is too large.', 400) if file_size_exceeded?
......
...@@ -37,7 +37,7 @@ RSpec.describe Packages::TerraformModule::CreatePackageService do ...@@ -37,7 +37,7 @@ RSpec.describe Packages::TerraformModule::CreatePackageService do
let!(:existing_package) { create(:terraform_module_package, project: project2, name: 'foo/bar', version: '1.0.0') } let!(:existing_package) { create(:terraform_module_package, project: project2, name: 'foo/bar', version: '1.0.0') }
it { expect(subject[:http_status]).to eq 403 } it { expect(subject[:http_status]).to eq 403 }
it { expect(subject[:message]).to be 'Package already exists.' } it { expect(subject[:message]).to be 'Access Denied' }
end end
context 'version already exists' do context 'version already exists' do
......
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