diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-03-15 14:18:44 +0100 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-03-28 13:58:35 +0200 |
commit | 1c3c7fb25d972fc19d5b4bb371cb21094d81e478 (patch) | |
tree | 1989aa0a7964ccdac4f6a6751f50967fe5fe801d /spec/models/system_note_metadata_spec.rb | |
parent | ad831ace7ed8d2ed999b15f8350aaa51f0490124 (diff) | |
download | gitlab-ce-1c3c7fb25d972fc19d5b4bb371cb21094d81e478.tar.gz |
Add system_note_metadata model
Diffstat (limited to 'spec/models/system_note_metadata_spec.rb')
-rw-r--r-- | spec/models/system_note_metadata_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/models/system_note_metadata_spec.rb b/spec/models/system_note_metadata_spec.rb new file mode 100644 index 00000000000..ae5a43281ac --- /dev/null +++ b/spec/models/system_note_metadata_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe SystemNoteMetadata, models: true do + describe 'associations' do + it { is_expected.to belong_to(:note) } + end + + describe 'validation' do + it { is_expected.to validate_presence_of(:note) } + + context 'when icon type is invalid' do + subject do + build(:system_note_metadata, note: build(:note), icon: 'invalid_type' ) + end + + it { is_expected.to be_invalid } + end + + context 'when icon type is valid' do + subject do + build(:system_note_metadata, note: build(:note), icon: 'merge' ) + end + + it { is_expected.to be_valid } + end + end +end |