diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-03 11:51:13 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-03 11:51:13 +0200 |
commit | 6fefa794304a6233368b592422ea0fb71a2700f0 (patch) | |
tree | df4483231f278753e380778695e82ffe25e687a2 /spec/models | |
parent | e10dae3e3c2a5fb6077244c72e44c912b7281349 (diff) | |
download | gitlab-ce-6fefa794304a6233368b592422ea0fb71a2700f0.tar.gz |
Validate uniqueness of container repository name
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/container_repository_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/container_repository_spec.rb b/spec/models/container_repository_spec.rb index f794085fc45..503da6556c0 100644 --- a/spec/models/container_repository_spec.rb +++ b/spec/models/container_repository_spec.rb @@ -21,6 +21,13 @@ describe ContainerRepository do headers: { 'Content-Type' => 'application/json' }) end + describe 'validations' do + it 'validates uniqueness of name scoped to project' do + expect(subject).to validate_uniqueness_of(:name) + .scoped_to(:project_id) + end + end + describe 'associations' do it 'belongs to the project' do expect(container_repository).to belong_to(:project) |