diff options
author | Markus Koller <markus-koller@gmx.ch> | 2017-09-18 15:03:24 +0200 |
---|---|---|
committer | Markus Koller <markus.koller.ext@siemens.com> | 2017-11-06 10:51:46 +0100 |
commit | 6902848a9c54f9eb1bfd82fe173ad0d5d62fe2d5 (patch) | |
tree | 9a28f3a4e52c7e6108a7f0358f813a375eec90a2 /spec/models/project_custom_attribute_spec.rb | |
parent | 823a9d351b49a6be8c12cfe06edb4aa6ec08fe95 (diff) | |
download | gitlab-ce-6902848a9c54f9eb1bfd82fe173ad0d5d62fe2d5.tar.gz |
Support custom attributes on projects
Diffstat (limited to 'spec/models/project_custom_attribute_spec.rb')
-rw-r--r-- | spec/models/project_custom_attribute_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/project_custom_attribute_spec.rb b/spec/models/project_custom_attribute_spec.rb new file mode 100644 index 00000000000..669de5506bc --- /dev/null +++ b/spec/models/project_custom_attribute_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe ProjectCustomAttribute do + describe 'assocations' do + it { is_expected.to belong_to(:project) } + end + + describe 'validations' do + subject { build :project_custom_attribute } + + it { is_expected.to validate_presence_of(:project) } + it { is_expected.to validate_presence_of(:key) } + it { is_expected.to validate_presence_of(:value) } + it { is_expected.to validate_uniqueness_of(:key).scoped_to(:project_id) } + end +end |