mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 18:45:23 +00:00
fix rspec due to change of optional parameter in ruby method
This commit is contained in:
parent
c30ed059fe
commit
c87579e1f7
@ -15,17 +15,17 @@ describe "Pet" do
|
||||
end
|
||||
|
||||
it "should find pets by status" do
|
||||
pets = PetApi.find_pets_by_status('available')
|
||||
pets = PetApi.find_pets_by_status(:status => 'available')
|
||||
pets.length.should >= 3
|
||||
end
|
||||
|
||||
it "should not find a pet with invalid status" do
|
||||
pets = PetApi.find_pets_by_status('invalid-status')
|
||||
pets = PetApi.find_pets_by_status(:status => 'invalid-status')
|
||||
pets.length.should == 0
|
||||
end
|
||||
|
||||
it "should find a pet by status" do
|
||||
pets = PetApi.find_pets_by_status("available,sold")
|
||||
pets = PetApi.find_pets_by_status(:status => "available,sold")
|
||||
pets.map {|pet|
|
||||
if(pet.status != 'available' && pet.status != 'sold')
|
||||
raise "pet status wasn't right"
|
||||
@ -35,7 +35,7 @@ describe "Pet" do
|
||||
|
||||
it "should update a pet" do
|
||||
pet = Pet.new({'id' => 10002, 'status' => 'sold'})
|
||||
PetApi.add_pet(pet)
|
||||
PetApi.add_pet(:body => pet)
|
||||
|
||||
fetched = PetApi.get_pet_by_id(10002)
|
||||
fetched.id.should == 10002
|
||||
@ -44,7 +44,7 @@ describe "Pet" do
|
||||
|
||||
it "should create a pet" do
|
||||
pet = Pet.new('id' => 10002, 'name' => "RUBY UNIT TESTING")
|
||||
PetApi.add_pet(pet)
|
||||
PetApi.add_pet(:body => pet)
|
||||
|
||||
pet = PetApi.get_pet_by_id(10002)
|
||||
pet.id.should == 10002
|
||||
|
@ -47,10 +47,10 @@ end
|
||||
# always delete and then re-create the pet object with 10002
|
||||
def prepare_pet
|
||||
# remove the pet
|
||||
PetApi.delete_pet('special-key', 10002)
|
||||
PetApi.delete_pet(10002)
|
||||
# recreate the pet
|
||||
pet = Pet.new('id' => 10002, 'name' => "RUBY UNIT TESTING")
|
||||
PetApi.add_pet(pet)
|
||||
PetApi.add_pet(:body => pet)
|
||||
end
|
||||
|
||||
# always delete and then re-create the store order
|
||||
@ -61,7 +61,7 @@ def prepare_store
|
||||
"shipDate" => "2015-04-06T23:42:01.678Z",
|
||||
"status" => "placed",
|
||||
"complete" => false)
|
||||
StoreApi.place_order(order)
|
||||
StoreApi.place_order(:body => order)
|
||||
end
|
||||
|
||||
configure_swagger
|
||||
|
Loading…
Reference in New Issue
Block a user