Commit d269d107 authored by Sebastian Ziebell's avatar Sebastian Ziebell

API: fixed adding a note

Now the correct attribute is checked if it's available or not. Also fixed a test.
parent 3bb342b9
...@@ -93,7 +93,7 @@ module Gitlab ...@@ -93,7 +93,7 @@ module Gitlab
# POST /projects/:id/issues/:noteable_id/notes # POST /projects/:id/issues/:noteable_id/notes
# POST /projects/:id/snippets/:noteable_id/notes # POST /projects/:id/snippets/:noteable_id/notes
post ":id/#{noteables_str}/:#{noteable_id_str}/notes" do post ":id/#{noteables_str}/:#{noteable_id_str}/notes" do
required_attributes! [:"#{noteable_id_str}"] required_attributes! [:body]
@noteable = user_project.send(:"#{noteables_str}").find(params[:"#{noteable_id_str}"]) @noteable = user_project.send(:"#{noteables_str}").find(params[:"#{noteable_id_str}"])
@note = @noteable.notes.new(note: params[:body]) @note = @noteable.notes.new(note: params[:body])
......
...@@ -466,8 +466,7 @@ describe Gitlab::API do ...@@ -466,8 +466,7 @@ describe Gitlab::API do
response.status.should == 200 response.status.should == 200
json_response.should be_an Array json_response.should be_an Array
#json_response.first['id'].should == project.repository.commit.id json_response.first['id'].should == project.repository.commit.id
json_response.size.should == 1
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment