File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
samples/client/petstore/ruby/spec/custom Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 2727
2828 describe '#base_url' do
2929 it 'should have the default value' do
30- expect ( config . base_url ) . to eq ( "http://petstore.swagger.io /v2" )
30+ expect ( config . base_url ) . to eq ( "http://localhost /v2" )
3131 end
3232
3333 it 'returns default value when invalid operation is passed' do
34- expect ( config . base_url ( 'invalid_operation' ) ) . to eq ( 'http://petstore.swagger.io /v2' )
34+ expect ( config . base_url ( 'invalid_operation' ) ) . to eq ( 'http://localhost /v2' )
3535 end
3636
3737 it 'returns proper URL default server_index' do
38- expect ( config . base_url ( :'PetApi.add_pet' ) ) . to eq ( 'http://petstore.swagger.io /v2' )
38+ expect ( config . base_url ( :'PetApi.add_pet' ) ) . to eq ( 'http://localhost /v2' )
3939 end
4040
4141 it 'returns proper URL when server_index is set' do
42- config . server_index = 1
42+ config . server_index = 2
4343 expect ( config . base_url ( :'PetApi.add_pet' ) ) . to eq ( 'http://path-server-test.petstore.local/v2' )
4444 end
4545
4646 it 'returns proper URL when server_operation_index is set' do
4747 config . server_operation_index = {
48- :'PetApi.add_pet' => 1
48+ :'PetApi.add_pet' => 2
4949 }
5050 expect ( config . base_url ( :'PetApi.add_pet' ) ) . to eq ( 'http://path-server-test.petstore.local/v2' )
5151 end
5252
5353 it 'returns proper URL from server_settings when server_index is set' do
54- config . server_index = 1
54+ config . server_index = 2
5555 expect ( config . base_url ) . to eq ( 'https://localhost:8080/v2' )
5656 end
5757
Original file line number Diff line number Diff line change 6666 expect ( index_backup ) . to eq ( { } )
6767 # test operation index 1 (invalid path)
6868 @pet_api . api_client . config . server_operation_index = {
69- :'PetApi.get_pet_by_id' => 1
69+ :'PetApi.get_pet_by_id' => 2
7070 }
7171
7272 expect ( @pet_api . api_client . config . base_url ( :'PetApi.get_pet_by_id' ) ) . to eq ( 'http://path-server-test.petstore.local/v2' )
8686 expect ( index_backup ) . to eq ( { } )
8787 # test operation index 3
8888 @pet_api . api_client . config . server_operation_index = {
89- :'PetApi.get_pet_by_id' => 3
89+ :'PetApi.get_pet_by_id' => 4
9090 }
9191
9292 expect ( @pet_api . api_client . config . base_url ( :'PetApi.get_pet_by_id' ) ) . to eq ( 'http://path.v2.test.openapi-generator.tech/v2' )
You can’t perform that action at this time.
0 commit comments