summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-13 15:48:52 +0100
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-13 15:48:52 +0100
commit6fc3263e15b71830e6f1b2a66891da5f4c055137 (patch)
treef46179ab65e682b260ab3ce09a83ce1d3988b153 /spec
parent54ab9bb6df3a2cd9f9384aebae07e0b18acee10b (diff)
downloadgitlab-ce-6fc3263e15b71830e6f1b2a66891da5f4c055137.tar.gz
API: extracted helper method to provide 400 bad request error with description
Extracted a method for 400 error (Bad request) and adjusted code accordingly. The name of the missing attribute is used to show which one was missing from the request. It is used to give an appropriate message in the json response.
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/merge_requests_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index 4e7a84dfb47..431aae7cc11 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -32,6 +32,11 @@ describe Gitlab::API do
response.status.should == 200
json_response['title'].should == merge_request.title
end
+
+ it "should return a 404 error if merge_request_id not found" do
+ get api("/projects/#{project.id}/merge_request/999", user)
+ response.status.should == 404
+ end
end
describe "POST /projects/:id/merge_requests" do