summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-13 11:54:02 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-04-13 11:54:02 +0200
commitb5b6c7b17527cc2360066557207af935bec2168f (patch)
tree5d1eb736f0d9a892f73dfff7f0739d75e7359079 /spec
parent259108ada340a0f1d49e2d80d1c433a377983e1c (diff)
downloadgitlab-ce-b5b6c7b17527cc2360066557207af935bec2168f.tar.gz
Sanitize container repository path in model classfix/gb/fix-registry-for-uppercased-project-paths
Diffstat (limited to 'spec')
-rw-r--r--spec/models/container_repository_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/models/container_repository_spec.rb b/spec/models/container_repository_spec.rb
index 6d6c9f2adfc..eff41d85972 100644
--- a/spec/models/container_repository_spec.rb
+++ b/spec/models/container_repository_spec.rb
@@ -34,8 +34,18 @@ describe ContainerRepository do
end
describe '#path' do
- it 'returns a full path to the repository' do
- expect(repository.path).to eq('group/test/my_image')
+ context 'when project path does not contain uppercase letters' do
+ it 'returns a full path to the repository' do
+ expect(repository.path).to eq('group/test/my_image')
+ end
+ end
+
+ context 'when path contains uppercase letters' do
+ let(:project) { create(:project, path: 'MY_PROJECT', group: group) }
+
+ it 'returns a full path without capital letters' do
+ expect(repository.path).to eq('group/my_project/my_image')
+ end
end
end