diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-02-07 14:34:30 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-02-07 14:34:30 +0400 |
commit | 4ecf30cd5b4731ed7735a658630729fd1c5fc993 (patch) | |
tree | 025397f44e64848baf9674b0acc5b5a0913cd128 /spec | |
parent | eb2f3a804475f3bbcdf168aba7d13539bd7104c6 (diff) |
Fix bug with cross-reference note on commit
It should not set noteable_id if noteable_type is Commit
We have Note#commit_id for this
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/note_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 7a00ee83ba4..6be8a6a13f6 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -250,6 +250,16 @@ describe Note do its(:project) { should == project } its(:note) { should == "_mentioned in merge request !#{mergereq.iid}_" } end + + context 'commit from issue' do + subject { Note.create_cross_reference_note(commit, issue, author, project) } + + it { should be_valid } + its(:noteable_type) { should == "Commit" } + its(:noteable_id) { should be_nil } + its(:commit_id) { should == commit.id } + its(:note) { should == "_mentioned in issue ##{issue.iid}_" } + end end describe '#cross_reference_exists?' do |