Skip to content

Commit baca302

Browse files
committed
Merge pull request #1298 from geekerzp/ruby_upload_file
[Ruby] Add test case in ruby client
2 parents 0e9e204 + c70ca9d commit baca302

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

samples/client/petstore/ruby/spec/pet_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,14 @@
116116
# nothing is returned
117117
result.should be_nil
118118
end
119+
120+
it "should upload a file with form parameter to a pet" do
121+
pet = Petstore::Pet.new('id' => 10002, 'name' => 'RUBY UNIT TESTING')
122+
result = @pet_api.add_pet(body: pet)
123+
result.should be_nil
124+
125+
result = @pet_api.upload_file(10002, file: File.new('hello.txt'), additional_metadata: 'metadata')
126+
result.should be_nil
127+
end
119128
end
120129
end

0 commit comments

Comments
 (0)