diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/mailers/notify_spec.rb | 2 | ||||
| -rw-r--r-- | spec/models/note_spec.rb | 18 |
2 files changed, 17 insertions, 3 deletions
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 4a9f142e50d..874864a3894 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -235,7 +235,7 @@ describe Notify do commit.stub(:safe_message).and_return('some message') end end - before(:each) { note.stub(:target).and_return(commit) } + before(:each) { note.stub(:noteable).and_return(commit) } subject { Notify.note_commit_email(recipient.id, note.id) } 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 |
