mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 15:22:56 +00:00
Demo swagger-driven tests with minitest and rspec
This commit is contained in:
@@ -3,16 +3,17 @@ require 'swagger_rails/testing/test_helpers'
|
||||
|
||||
class V1ContractTest < ActionDispatch::IntegrationTest
|
||||
include SwaggerRails::TestHelpers
|
||||
|
||||
swagger_doc 'v1/swagger.json'
|
||||
#
|
||||
# test '/blogs post' do
|
||||
# swagger_test '/blogs', 'post'
|
||||
# end
|
||||
|
||||
test '/blogs get' do
|
||||
blog = Blog.create(title: 'Test Blog', content: 'Hello World')
|
||||
# TODO: improve DSL
|
||||
|
||||
test 'Blogs API' do
|
||||
swagger_test '/blogs', 'post'
|
||||
|
||||
swagger_test '/blogs', 'get'
|
||||
|
||||
swagger_test '/blogs/{id}', 'get' do
|
||||
set id: Blog.last!.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user