diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-06-21 18:49:27 +0300 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-07-04 22:18:44 +0300 |
commit | 2def0522f68d4cb2106de32e4d6fc90fb37dab39 (patch) | |
tree | 037156c809b9b3092f3a50b828d2da073cc3d81a /spec/validators | |
parent | e1e3087c721f20fb0c5a09037c921cf630123e88 (diff) |
Merge branch 'bvl-validate-path-update' into 'master'
Rebuild the dynamic path before validating it
Closes #33746
See merge request !12213
Diffstat (limited to 'spec/validators')
-rw-r--r-- | spec/validators/dynamic_path_validator_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/validators/dynamic_path_validator_spec.rb b/spec/validators/dynamic_path_validator_spec.rb index 8dbf3eecd23..8bd5306ff98 100644 --- a/spec/validators/dynamic_path_validator_spec.rb +++ b/spec/validators/dynamic_path_validator_spec.rb @@ -84,5 +84,14 @@ describe DynamicPathValidator do expect(group.errors[:path]).to include('users is a reserved name') end + + it 'updating to an invalid path is not allowed' do + project = create(:empty_project) + project.path = 'update' + + validator.validate_each(project, :path, 'update') + + expect(project.errors[:path]).to include('update is a reserved name') + end end end |