diff options
author | Valery Sizov <valery@gitlab.com> | 2015-12-10 14:36:31 +0200 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-12-10 14:39:37 +0200 |
commit | e3ee46a13b91a6cefb0efb1841fb24afed37b674 (patch) | |
tree | 567e66fbb0a3ecdc81a1a88509d4f8601161fd1e /spec/models/note_spec.rb | |
parent | bdc62d704c79b8f4e39dc7b5660b8d657a434895 (diff) | |
download | gitlab-ce-e3ee46a13b91a6cefb0efb1841fb24afed37b674.tar.gz |
Don't allow to edit award emoji commentsemoji_edit_disallow
Diffstat (limited to 'spec/models/note_spec.rb')
-rw-r--r-- | spec/models/note_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index cd3c868ecc5..5b6f177ebb2 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -142,4 +142,21 @@ describe Note, models: true do expect(Note.grouped_awards.first.last).to match_array(Note.all) end end + + describe "editable?" do + it "returns true" do + note = build(:note) + expect(note.editable?).to be_truthy + end + + it "returns false" do + note = build(:note, system: true) + expect(note.editable?).to be_falsy + end + + it "returns false" do + note = build(:note, is_award: true, note: "smiley") + expect(note.editable?).to be_falsy + end + end end |