diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-14 11:27:50 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-07-14 11:27:50 +0200 |
commit | 418af1010aa65dfa38b53f4393b2ca6c1dc9cbfb (patch) | |
tree | 98bb7cb9a8d1951fddf180c7fbd1492d206fd48a | |
parent | 881bc45abb5999b771c1ef01faae2b4e65f7b410 (diff) | |
download | gitlab-ce-418af1010aa65dfa38b53f4393b2ca6c1dc9cbfb.tar.gz |
Adds specs for renaming a project with container images
-rw-r--r-- | spec/services/projects/update_service_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb index cdf61eb28cf..fd4011ad606 100644 --- a/spec/services/projects/update_service_spec.rb +++ b/spec/services/projects/update_service_spec.rb @@ -103,6 +103,21 @@ describe Projects::UpdateService, '#execute', :services do end end + context 'when renaming project that contains container images' do + before do + stub_container_registry_config(enabled: true) + stub_container_registry_tags(repository: /image/, tags: %w[rc1]) + create(:container_repository, project: project, name: :image) + end + + it 'does not allow to rename the project' do + result = update_project(project, admin, path: 'renamed') + + expect(result).to include(status: :error) + expect(result[:message]).to match(/contains container registry tags/) + end + end + context 'when passing invalid parameters' do it 'returns an error result when record cannot be updated' do result = update_project(project, admin, { name: 'foo&bar' }) |