Commit graph

9 commits

Author SHA1 Message Date
Rémy Coutable
5f7592d538 Implement json_response as a let variable
This is not a good idea to memoize `json_response` using an instance
variable because `rspec-retry` doesn't clear instance variables on
retries, only `let` variables.

This will avoid issues where retries would fail on a different line that
the original failure, blurrying what's the real failure.

Also, automatically add api: true to specs under
/spec/requests/(ci/)?api/, and include JsonHelpers in controller, request
and API specs.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-03-13 17:33:17 +01:00
Oswaldo Ferreira
cadef80275 Remain V3 endpoint unchanged 2017-01-30 17:00:21 -02:00
Grzegorz Bizon
07be594378 Enable Style/MultilineTernaryOperator rubocop cop
Avoid multi-line ?: (the ternary operator). Use if/unless instead.

See #17478
2016-07-20 14:24:39 +02:00
Valery Sizov
910bf96ec3 fix specs. Stage 2 2015-09-14 18:14:17 +03:00
Robert Speicher
1f9a2ab7c9 Memoize result of JSON.parse in json_response
This might see a minor speedup in test cases that call this method many
times.
2015-06-10 01:31:27 -04:00
Dmitriy Zaporozhets
634cbd7138 Refactor API classes. So api classes like Gitlab::Issues become API::Issues 2013-05-14 15:33:31 +03:00
Nihad Abbasov
968c09ae91 API version returns last version set
* fixed in grape v0.2.2
2012-12-01 02:03:51 -08:00
Robert Speicher
b2a5344a2d Add a simple api method to ApiHelpers, replacing api_prefix
See docs for usage
2012-08-25 14:19:15 -04:00
Robert Speicher
fba174e9bc Cleanup spec/support folder and spec/spec_helper
Changes:
* Move spec/monkeypatch to spec/support
* Remove unused support/shared_examples
* Move support/api to support/api_helpers to match module name
* Move support/login to support/login_helpers to match module name
* Move API specs to requests/api (convention over configuration)
* Remove unused support/js_patch
* Simplify login_as helper
* Move DatabaseCleaner stuff to its own support file
* Remove unnecessary configuration and requires from spec_helper
2012-08-25 14:19:15 -04:00