summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-01-25 19:35:27 -0200
committerOswaldo Ferreira <oswaldo@gitlab.com>2017-02-03 12:29:16 -0200
commit082f1af5df04ebfe7ef700fd94b713206ad41b5b (patch)
tree333a1a51bf4622b3d9443317b4e1980c94af9fca /spec/support
parenta89aab9c630593524b8a210746d2eb680ac5d102 (diff)
downloadgitlab-ce-27180-v4-api-namespace-introduction.tar.gz
Remove deprecated MR and Issue endpoints and preserve V3 namespace27180-v4-api-namespace-introduction
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/api_helpers.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/support/api_helpers.rb b/spec/support/api_helpers.rb
index 68b196d9033..ae6e708cf87 100644
--- a/spec/support/api_helpers.rb
+++ b/spec/support/api_helpers.rb
@@ -17,8 +17,8 @@ module ApiHelpers
# => "/api/v2/issues?foo=bar&private_token=..."
#
# Returns the relative path to the requested API resource
- def api(path, user = nil)
- "/api/#{API::API.version}#{path}" +
+ def api(path, user = nil, version: API::API.version)
+ "/api/#{version}#{path}" +
# Normalize query string
(path.index('?') ? '' : '?') +
@@ -31,6 +31,11 @@ module ApiHelpers
end
end
+ # Temporary helper method for simplifying V3 exclusive API specs
+ def v3_api(path, user = nil)
+ api(path, user, version: 'v3')
+ end
+
def ci_api(path, user = nil)
"/ci/api/v1/#{path}" +