Merge pull request #1629 from riyad/show-notes-indicator-for-commits-and-merge-requests

Show numer of notes for commits and merge requests
This commit is contained in:
Dmitriy Zaporozhets 2012-10-10 01:45:39 -07:00
commit dda852a0d5
5 changed files with 33 additions and 1 deletions

View file

@ -35,4 +35,19 @@ describe MergeRequest do
it { should include_module(IssueCommonality) }
it { should include_module(Votes) }
end
describe "#mr_and_commit_notes" do
let!(:merge_request) { Factory.create(:merge_request) }
before do
merge_request.stub(:commits) { [merge_request.project.commit] }
Factory.create(:note, noteable: merge_request.commits.first)
Factory.create(:note, noteable: merge_request)
end
it "should include notes for commits" do
merge_request.commits.should_not be_empty
merge_request.mr_and_commit_notes.count.should == 2
end
end
end