API documentation and spec setup

This commit is contained in:
wvengen 2018-10-15 16:47:14 +02:00 committed by wvengen
parent 99ecb75c83
commit 900cc91197
7 changed files with 226 additions and 0 deletions

View 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