diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-12-19 21:44:32 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-01-03 16:18:05 +0300 |
commit | f10fe3ae97ade4ad73963b86c9ab2d7e4e021c61 (patch) | |
tree | 20d9a9e3c67d5e38a31e029be51dbdac16785c0e /spec/lib/api/api_spec.rb | |
parent | 128a5e410f4c51bbbcb1540435d3bea0b9a9c04d (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.rb | 17 |
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 |