diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-01-30 15:41:56 -0200 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-01-30 17:00:21 -0200 |
commit | cadef802758ce4cf0b59849ca4613545967c2da6 (patch) | |
tree | 5a5790829e6b2ffcbde9f0084ce7a76bc991e24b /spec/support/api_helpers.rb | |
parent | cc24682b58a66a217e6ffa1d56f8d45900c10d03 (diff) | |
download | gitlab-ce-cadef802758ce4cf0b59849ca4613545967c2da6.tar.gz |
Remain V3 endpoint unchanged
Diffstat (limited to 'spec/support/api_helpers.rb')
-rw-r--r-- | spec/support/api_helpers.rb | 9 |
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}" + |