diff options
| author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-10-13 16:23:12 +0200 |
|---|---|---|
| committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-10-13 16:23:12 +0200 |
| commit | b1461de993daf6d43c8a54482eecacc6bb58df4d (patch) | |
| tree | 56ed0f0fda021640620a824a261170c8e14aca0e /spec/models/note_spec.rb | |
| parent | db3d90cbcb41c5b9a62998b185c90c10f9d03968 (diff) | |
| download | gitlab-ce-b1461de993daf6d43c8a54482eecacc6bb58df4d.tar.gz | |
Make Note methods saner
Diffstat (limited to 'spec/models/note_spec.rb')
| -rw-r--r-- | spec/models/note_spec.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 8b622d5b8c5..514b6202b74 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -85,9 +85,19 @@ describe Note do noteable_type: "Commit" end + it "should be accessible through #noteable" do + @note.noteable_id.should == commit.id + @note.noteable.should be_a(Commit) + @note.noteable.should == commit + end + it "should save a valid note" do @note.noteable_id.should == commit.id - @note.target.id.should == commit.id + @note.noteable == commit + end + + it "should be recognized by #for_commit?" do + @note.should be_for_commit end end @@ -101,7 +111,11 @@ describe Note do it "should save a valid note" do @note.noteable_id.should == commit.id - @note.target.id.should == commit.id + @note.noteable.id.should == commit.id + end + + it "should be recognized by #for_diff_line?" do + @note.should be_for_diff_line end end |
