Commit graph

14 commits

Author SHA1 Message Date
Sebastian Ziebell 3b3add35fb API: merge request documentation updated, added return codes to functions
The API documentation of merge requests contains info to status codes for all functions.
Required arguments are now checked in the merge requests API functions and a `400 Bad Request` error is
returned if they are not given.
2013-02-27 15:07:42 +01:00
Sebastian Ziebell eefb27f5ae Merge branch 'master' into fixes/api
Conflicts:
	spec/requests/api/projects_spec.rb
2013-02-20 12:43:32 +01:00
Andrew8xx8 29f70acc98 Merge Request uses StateMachine now 2013-02-18 14:43:50 +04:00
Sebastian Ziebell 6fc3263e15 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.
2013-02-13 15:48:52 +01:00
Sebastian Ziebell 41e93bbfe2 Test added to check creation of note to a non-existent MR via API 2013-02-06 17:05:55 +01:00
Sebastian Ziebell f978a71f41 Creating MR comment without a note returns status code 400 (Bad request)
Creating a comment to an existing merge request via API without providing a note
returns a status code 400 now, suggesting a bad request. The reason for this
is the resource itself (MR) exists but the required property is not set.
2013-02-06 17:02:30 +01:00
Sebastian Ziebell 413952ff94 Creating or updating a MR returns more informative status codes.
Using the API library to create or update a merge request at the moment a 404 error is returned.
This is fine when the merge request in question does not exist, but does not provide good
information that for example a required attribute is missing.
A status code of 400 (Bad request) is returned when creating or updating a merge request
when either `source_branch` or `target_branch` is missing. A status code of 409 is returned
when `source_branch` and `target_branch` are the same. Tests are added for these cases.
2013-02-06 16:57:00 +01:00
Dmitriy Zaporozhets afbdbb0c95 Rspec fixes 2013-01-04 18:50:31 +02:00
Dmitriy Zaporozhets ccf0686b01 Fix api specs. Use id instead path 2013-01-02 19:46:06 +02:00
Dmitriy Zaporozhets d431e43392 Fix few bugs and tests after refactoring ownership logic 2013-01-02 19:32:34 +02:00
Dmitriy Zaporozhets 9304d049de Fixed some tests and snippet colorize 2012-11-23 22:31:09 +03:00
Vincent Bonmalais 80fb38de7a Remove backward compatibility of factories. 2012-11-13 22:27:45 +11:00
Valeriy Sizov 56bf829c75 API: fix after review 2012-10-25 13:19:18 +03:00
Valeriy Sizov e6cdfb607a API: tests for merge_requests 2012-10-25 13:13:01 +03:00