mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-23 14:27:21 +00:00
23 lines
601 B
Ruby
23 lines
601 B
Ruby
require 'swagger_helper'
|
|
|
|
describe 'Auth Tests API', type: :request, swagger_doc: 'v1/swagger.json' do
|
|
|
|
path '/auth-tests/basic' do
|
|
post 'Authenticates with basic auth' do
|
|
tags 'Auth Test'
|
|
operationId 'testBasicAuth'
|
|
security [ basic_auth: [] ]
|
|
|
|
response '204', 'Valid credentials' do
|
|
let(:Authorization) { "Basic #{::Base64.strict_encode64('jsmith:jspass')}" }
|
|
run_test!
|
|
end
|
|
|
|
response '401', 'Invalid credentials' do
|
|
let(:Authorization) { "Basic #{::Base64.strict_encode64('foo:bar')}" }
|
|
run_test!
|
|
end
|
|
end
|
|
end
|
|
end
|