API documentation and spec setup
This commit is contained in:
parent
99ecb75c83
commit
900cc91197
7 changed files with 226 additions and 0 deletions
19
spec/api/v1/swagger_spec.rb
Normal file
19
spec/api/v1/swagger_spec.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
require 'spec_helper'
|
||||
require 'apivore'
|
||||
|
||||
# we want to load a local file in YAML-format instead of a served JSON file
|
||||
class SwaggerCheckerFile < Apivore::SwaggerChecker
|
||||
def fetch_swagger!
|
||||
YAML.load(File.read(swagger_path))
|
||||
end
|
||||
end
|
||||
|
||||
describe 'API v1', type: :apivore, order: :defined do
|
||||
include ApiHelper
|
||||
|
||||
subject { SwaggerCheckerFile.instance_for Rails.root.join('doc', 'swagger.v1.yml') }
|
||||
|
||||
it 'tests all documented routes' do
|
||||
is_expected.to validate_all_paths
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue