Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-12-19 21:44:32 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-01-03 16:18:05 +0300
commitf10fe3ae97ade4ad73963b86c9ab2d7e4e021c61 (patch)
tree20d9a9e3c67d5e38a31e029be51dbdac16785c0e /spec/lib/api/api_spec.rb
parent128a5e410f4c51bbbcb1540435d3bea0b9a9c04d (diff)
Add API::Helpers::Version and expose API root URL
This commits adds a new class that is supposed to represent Grape API version, like `v3` or `v4`.
Diffstat (limited to 'spec/lib/api/api_spec.rb')
-rw-r--r--spec/lib/api/api_spec.rb17
1 files changed, 1 insertions, 16 deletions
diff --git a/spec/lib/api/api_spec.rb b/spec/lib/api/api_spec.rb
index 31881551980..ceef0b41e59 100644
--- a/spec/lib/api/api_spec.rb
+++ b/spec/lib/api/api_spec.rb
@@ -15,22 +15,7 @@ describe API::API do
describe '.versions' do
it 'returns all available versions' do
- expect(described_class.versions).to eq ['v3', 'v4']
- end
- end
-
- describe '.root_path' do
- it 'returns predefined API version path' do
- expect(described_class.root_path).to eq '/api/v4'
- end
-
- it 'returns a version provided as keyword argument' do
- expect(described_class.root_path(version: 'v3')).to eq '/api/v3'
- end
-
- it 'raises an error if version is not known' do
- expect { described_class.root_path(version: 'v10') }
- .to raise_error ArgumentError
+ expect(described_class.versions).to eq %w[v3 v4]
end
end
end