require 'spec_helper' require 'json' # Unit tests for AsposeCellsCloud::CellsSaveAsApi # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) # Please update as you see appropriate describe 'CellsSaveAsApi' do before do @instance = AsposeCellsCloud::CellsApi.new($client_id,$client_secret,"v3.0") end after do # run after each test end # unit tests for cells_save_as_post_document_save_as # Convert document and save result to storage. # # @param name The document name. # @param [Hash] opts the optional parameters # @option opts [SaveOptions] :save_options Save options. # @option opts [String] :newfilename The new file name. # @option opts [BOOLEAN] :is_auto_fit_rows Autofit rows. # @option opts [BOOLEAN] :is_auto_fit_columns Autofit columns. # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [SaveResponse] describe 'cells_save_as_post_document_save_as test' do it "should work" do name = $BOOK1 save_options = nil newfilename = 'newbook.xlsx' is_auto_fit_rows = true is_auto_fit_columns = true folder = $TEMPFOLDER result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>newfilename, :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for cells_save_as_post_document_save_as # Convert document and save result to storage. # # @param name The document name. # @param [Hash] opts the optional parameters # @option opts [SaveOptions] :save_options Save options. # @option opts [String] :newfilename The new file name. # @option opts [BOOLEAN] :is_auto_fit_rows Autofit rows. # @option opts [BOOLEAN] :is_auto_fit_columns Autofit columns. # @option opts [String] :folder The document folder. # @option opts [String] :storage storage name. # @return [SaveResponse] describe 'cells_save_as_post_document_save_as md format test' do it "should work" do name = $BOOK1 save_options = nil newfilename = 'newbook.xls.md' is_auto_fit_rows = true is_auto_fit_columns = true folder = $TEMPFOLDER result = @instance.upload_file( folder+"/"+name, ::File.open(File.expand_path("data/"+name),"r") {|io| io.read(io.size) }) expect(result.uploaded.size).to be > 0 result = @instance.cells_save_as_post_document_save_as(name, { :save_options=>save_options, :newfilename=>newfilename, :is_auto_fit_rows=>is_auto_fit_rows, :is_auto_fit_columns=>is_auto_fit_columns, :folder=>folder}) expect(result.code).to eql(200) # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end end