diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-13 12:54:02 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-13 12:54:02 +0300 |
commit | b5b6c7b17527cc2360066557207af935bec2168f (patch) | |
tree | 5d1eb736f0d9a892f73dfff7f0739d75e7359079 /spec/models/container_repository_spec.rb | |
parent | 259108ada340a0f1d49e2d80d1c433a377983e1c (diff) |
Sanitize container repository path in model class
Diffstat (limited to 'spec/models/container_repository_spec.rb')
-rw-r--r-- | spec/models/container_repository_spec.rb | 14 |
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 |