diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-31 10:42:11 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-31 10:42:11 +0400 |
commit | 9da7b2e8d8ed08cb193af2babf150cb8c7715f80 (patch) | |
tree | 2ca599b61b8cbd61f3421166106062e8dc399344 /spec/requests/api/notes_spec.rb | |
parent | a037c9c2497bf6a813d2138afae22e55cde8b093 (diff) |
add specs for api -> merge request notes
Diffstat (limited to 'spec/requests/api/notes_spec.rb')
-rw-r--r-- | spec/requests/api/notes_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb index ae4fc111f63..ee99d85df4d 100644 --- a/spec/requests/api/notes_spec.rb +++ b/spec/requests/api/notes_spec.rb @@ -6,8 +6,10 @@ describe Gitlab::API do let(:user) { create(:user) } let!(:project) { create(:project, namespace: user.namespace ) } let!(:issue) { create(:issue, project: project, author: user) } + let!(:merge_request) { create(:merge_request, project: project, author: user) } let!(:snippet) { create(:snippet, project: project, author: user) } let!(:issue_note) { create(:note, noteable: issue, project: project, author: user) } + let!(:merge_request_note) { create(:note, noteable: merge_request, project: project, author: user) } let!(:snippet_note) { create(:note, noteable: snippet, project: project, author: user) } let!(:wall_note) { create(:note, project: project, author: user) } before { project.team << [user, :reporter] } @@ -64,6 +66,15 @@ describe Gitlab::API do json_response.first['body'].should == snippet_note.note end end + + context "when noteable is a Merge Request" do + it "should return an array of merge_requests notes" do + get api("/projects/#{project.id}/merge_requests/#{merge_request.id}/notes", user) + response.status.should == 200 + json_response.should be_an Array + json_response.first['body'].should == merge_request_note.note + end + end end describe "GET /projects/:id/noteable/:noteable_id/notes/:note_id" do |