forked from loafle/openapi-generator-original
fix defeault rspec test for ruby, update security petstore
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
=begin
|
||||
#Swagger Petstore */ ' \" =end
|
||||
#Swagger Petstore */ ' \" =_end -- \\r\\n \\n \\r
|
||||
|
||||
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =end
|
||||
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =_end --
|
||||
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =end
|
||||
Contact: apiteam@swagger.io */ ' \" =end
|
||||
OpenAPI spec version: 1.0.0 */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Contact: apiteam@swagger.io */ ' \" =_end -- \\r\\n \\n \\r
|
||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -27,21 +27,26 @@ describe Petstore::Configuration do
|
||||
let(:config) { Petstore::Configuration.default }
|
||||
|
||||
before(:each) do
|
||||
Petstore.configure do |c|
|
||||
c.host = 'petstore.swagger.io'
|
||||
c.base_path = 'v2'
|
||||
end
|
||||
# uncomment below to setup host and base_path
|
||||
#require 'URI'
|
||||
#uri = URI.parse("https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r")
|
||||
#Petstore.configure do |c|
|
||||
# c.host = uri.host
|
||||
# c.base_path = uri.path
|
||||
#end
|
||||
end
|
||||
|
||||
describe '#base_url' do
|
||||
it 'should have the default value' do
|
||||
expect(config.base_url).to eq('http://petstore.swagger.io/v2')
|
||||
# uncomment below to test default value of the base path
|
||||
#expect(config.base_url).to eq("https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r")
|
||||
end
|
||||
|
||||
it 'should remove trailing slashes' do
|
||||
[nil, '', '/', '//'].each do |base_path|
|
||||
config.base_path = base_path
|
||||
expect(config.base_url).to eq('http://petstore.swagger.io')
|
||||
# uncomment below to test trailing slashes
|
||||
#expect(config.base_url).to eq("https://petstore.swagger.io */ ' \" =_end -- \\r\\n \\n \\r/v2 */ ' \" =_end -- \\r\\n \\n \\r")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user