=begin #API v1 #DocSpring is a service that helps you fill out and sign PDF templates. The version of the OpenAPI document: v1 Generated by: https://openapi-generator.tech Generator version: 7.11.0 =end require 'spec_helper' require 'json' # Unit tests for DocSpring::PDFApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'PDFApi' do before do # <--------------- BEGIN DOCSPRING CUSTOMIZATION -----------------> # Description: Configure auth and host for testing, # replace @api_instance with let(:api_instance) DocSpring.configure do |c| c.username = 'api_token123' c.password = 'testsecret123' c.host = 'api.docspring.localhost:31337' c.scheme = 'http' end end let(:api_instance) { DocSpring::PDFApi.new } # <--------------- END DOCSPRING CUSTOMIZATION -----------------> after do # run after each test end describe 'test an instance of PDFApi' do it 'should create an instance of PDFApi' do # <--------------- BEGIN DOCSPRING CUSTOMIZATION -----------------> # Description: Replace @api_instance with api_instance expect(api_instance).to be_instance_of(DocSpring::PDFApi) # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # <--------------- BEGIN DOCSPRING CUSTOMIZATION -----------------> # Description: Replace empty test with e2e integration test # integration tests for add_fields_to_template # Add new fields to a Template # @param template_id # @param data # @param [Hash] opts the optional parameters # @return [AddFieldsTemplateResponse] describe 'add_fields_to_template test' do it 'should work' do template_id = tpl_000000000000000002 # String | data = # AddFieldsData | result = api_instance. add_fields_to_template( template_id, data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for batch_generate_pdf_v1 # Generates multiple PDFs # @param template_id # @param data # @param [Hash] opts the optional parameters # @return [Array] describe 'batch_generate_pdf_v1 test' do it 'should work' do template_id = tpl_000000000000000001 # String | data = # Array | result = api_instance. batch_generate_pdf_v1( template_id, data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for batch_generate_pdfs # Generates multiple PDFs # @param data # @param [Hash] opts the optional parameters # @return [CreateSubmissionBatchResponse] describe 'batch_generate_pdfs test' do it 'should work' do data = # SubmissionBatchData | result = api_instance. batch_generate_pdfs( data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for combine_pdfs # Merge submission PDFs, template PDFs, or custom files # @param data # @param [Hash] opts the optional parameters # @return [CreateCombinedSubmissionResponse] describe 'combine_pdfs test' do it 'should work' do data = # CombinePdfsData | result = api_instance. combine_pdfs( data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for combine_submissions # Merge generated PDFs together # @param data # @param [Hash] opts the optional parameters # @return [CreateCombinedSubmissionResponse] describe 'combine_submissions test' do it 'should work' do data = # CombinedSubmissionData | result = api_instance. combine_submissions( data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for copy_template # Copy a Template # @param template_id # @param data # @param [Hash] opts the optional parameters # @return [Template] describe 'copy_template test' do it 'should work' do template_id = tpl_000000000000000001 # String | data = # CopyTemplateData | result = api_instance. copy_template( template_id, data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for create_custom_file_from_upload # Create a new custom file from a cached presign upload # @param data # @param [Hash] opts the optional parameters # @return [CreateCustomFileResponse] describe 'create_custom_file_from_upload test' do it 'should work' do data = # CreateCustomFileData | result = api_instance. create_custom_file_from_upload( data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for create_data_request_event # Creates a new event for emailing a signee a request for signature # @param data_request_id # @param event # @param [Hash] opts the optional parameters # @return [CreateSubmissionDataRequestEventResponse] describe 'create_data_request_event test' do it 'should work' do data_request_id = drq_000000000000000001 # String | event = # CreateSubmissionDataRequestEventRequest | result = api_instance. create_data_request_event( data_request_id, event ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for create_data_request_token # Creates a new data request token for form authentication # @param data_request_id # @param [Hash] opts the optional parameters # @return [CreateSubmissionDataRequestTokenResponse] describe 'create_data_request_token test' do it 'should work' do data_request_id = drq_000000000000000001 # String | result = api_instance. create_data_request_token( data_request_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for create_folder # Create a folder # @param data # @param [Hash] opts the optional parameters # @return [Folder] describe 'create_folder test' do it 'should work' do data = # CreateFolderData | result = api_instance. create_folder( data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for create_html_template # Create a new HTML template # @param data # @param [Hash] opts the optional parameters # @return [PendingTemplate] describe 'create_html_template test' do it 'should work' do data = # CreateHtmlTemplateData | result = api_instance. create_html_template( data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for create_pdf_template # Create a new PDF template with a form POST file upload # @param template_document # @param template_name # @param [Hash] opts the optional parameters # @option opts [String] :template_parent_folder_id # @return [PendingTemplate] describe 'create_pdf_template test' do it 'should work' do template_document = BINARY_DATA_HERE # File | template_name = template_name_example # String | opts = { template_parent_folder_id: template_parent_folder_id_example # String | } result = api_instance. create_pdf_template( template_document, template_name, opts ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for create_pdf_template_from_upload # Create a new PDF template from a cached presign upload # @param data # @param [Hash] opts the optional parameters # @return [PendingTemplate] describe 'create_pdf_template_from_upload test' do it 'should work' do data = # CreateTemplateFromUploadData | result = api_instance. create_pdf_template_from_upload( data ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for delete_folder # Delete a folder # @param folder_id # @param [Hash] opts the optional parameters # @return [Folder] describe 'delete_folder test' do it 'should work' do folder_id = fld_0000000000000000001 # String | result = api_instance. delete_folder( folder_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for delete_template # Delete a template # @param template_id # @param [Hash] opts the optional parameters # @option opts [String] :version # @return [DeleteTemplateResponse] describe 'delete_template test' do it 'should work' do template_id = tpl_000000000000000001 # String | opts = { version: 0.1.0 # String | } result = api_instance. delete_template( template_id, opts ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for expire_combined_submission # Expire a combined submission # @param combined_submission_id # @param [Hash] opts the optional parameters # @return [CombinedSubmission] describe 'expire_combined_submission test' do it 'should work' do combined_submission_id = com_0000000000000000001 # String | result = api_instance. expire_combined_submission( combined_submission_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for expire_submission # Expire a PDF submission # @param submission_id # @param [Hash] opts the optional parameters # @return [Submission] describe 'expire_submission test' do it 'should work' do submission_id = sub_000000000000000001 # String | result = api_instance. expire_submission( submission_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for generate_pdf # Generates a new PDF # @param template_id # @param submission # @param [Hash] opts the optional parameters # @return [CreateSubmissionResponse] describe 'generate_pdf test' do it 'should work' do template_id = tpl_000000000000000001 # String | submission = # CreateSubmissionData | result = api_instance. generate_pdf( template_id, submission ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for generate_preview # Generated a preview PDF for partially completed data requests # @param submission_id # @param [Hash] opts the optional parameters # @return [PreviewPdfResponse] describe 'generate_preview test' do it 'should work' do submission_id = sub_00000000000000001 # String | result = api_instance. generate_preview( submission_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for get_combined_submission # Check the status of a combined submission (merged PDFs) # @param combined_submission_id # @param [Hash] opts the optional parameters # @return [CombinedSubmission] describe 'get_combined_submission test' do it 'should work' do combined_submission_id = com_0000000000000000001 # String | result = api_instance. get_combined_submission( combined_submission_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for get_data_request # Look up a submission data request # @param data_request_id # @param [Hash] opts the optional parameters # @return [SubmissionDataRequest] describe 'get_data_request test' do it 'should work' do data_request_id = drq_000000000000000001 # String | result = api_instance. get_data_request( data_request_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for get_full_template # Fetch the full template attributes # @param template_id # @param [Hash] opts the optional parameters # @return [FullTemplate] describe 'get_full_template test' do it 'should work' do template_id = tpl_000000000000000001 # String | result = api_instance. get_full_template( template_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for get_presign_url # Get a presigned URL so that you can upload a file to our AWS S3 bucket # @param [Hash] opts the optional parameters # @return [UploadPresign] describe 'get_presign_url test' do it 'should work' do result = api_instance. get_presign_url expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for get_submission # Check the status of a PDF # @param submission_id # @param [Hash] opts the optional parameters # @option opts [Boolean] :include_data # @return [Submission] describe 'get_submission test' do it 'should work' do submission_id = sub_000000000000000001 # String | opts = { include_data: true # Boolean | } result = api_instance. get_submission( submission_id, opts ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for get_submission_batch # Check the status of a submission batch job # @param submission_batch_id # @param [Hash] opts the optional parameters # @option opts [Boolean] :include_submissions # @return [SubmissionBatch] describe 'get_submission_batch test' do it 'should work' do submission_batch_id = sbb_000000000000000001 # String | opts = { include_submissions: true # Boolean | } result = api_instance. get_submission_batch( submission_batch_id, opts ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for get_template # Check the status of an uploaded template # @param template_id # @param [Hash] opts the optional parameters # @return [Template] describe 'get_template test' do it 'should work' do template_id = tpl_000000000000000001 # String | result = api_instance. get_template( template_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for get_template_schema # Fetch the JSON schema for a template # @param template_id # @param [Hash] opts the optional parameters # @return [TemplateSchema] describe 'get_template_schema test' do it 'should work' do template_id = tpl_000000000000000001 # String | result = api_instance. get_template_schema( template_id ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for list_combined_submissions # Get a list of all combined submissions # @param [Hash] opts the optional parameters # @option opts [Integer] :page Default: 1 # @option opts [Integer] :per_page Default: 50 # @return [Array] describe 'list_combined_submissions test' do it 'should work' do opts = { page: 2, # Integer | Default: 1 per_page: 1 # Integer | Default: 50 } result = api_instance. list_combined_submissions( opts ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for list_folders # Get a list of all folders # @param [Hash] opts the optional parameters # @option opts [String] :parent_folder_id Filter By Folder Id # @return [Array] describe 'list_folders test' do it 'should work' do opts = { parent_folder_id: fld_0000000000000000002 # String | Filter By Folder Id } result = api_instance. list_folders( opts ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for list_submissions # List all submissions # @param [Hash] opts the optional parameters # @option opts [String] :cursor # @option opts [Float] :limit # @option opts [String] :created_after # @option opts [String] :created_before # @option opts [String] :type # @option opts [Boolean] :include_data # @return [ListSubmissionsResponse] describe 'list_submissions test' do it 'should work' do opts = { cursor: sub_list_000012, # String | limit: 3, # Float | created_after: 2019-01-01T09:00:00-05:00, # String | created_before: 2020-01-01T09:00:00.000+0200, # String | type: test, # String | include_data: true # Boolean | } result = api_instance. list_submissions( opts ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for list_template_submissions # List all submissions for a given template # @param template_id # @param [Hash] opts the optional parameters # @option opts [String] :cursor # @option opts [Float] :limit # @option opts [String] :created_after # @option opts [String] :created_before # @option opts [String] :type # @option opts [Boolean] :include_data # @return [ListSubmissionsResponse] describe 'list_template_submissions test' do it 'should work' do template_id = tpl_000000000000000002 # String | opts = { cursor: cursor_example, # String | limit: 8.14, # Float | created_after: created_after_example, # String | created_before: created_before_example, # String | type: type_example, # String | include_data: true # Boolean | } result = api_instance. list_template_submissions( template_id, opts ) expect(result).to_not be_nil # <--------------- END DOCSPRING CUSTOMIZATION -----------------> end end # integration tests for list_templates # Get a list of all templates # @param [Hash] opts the optional parameters # @option opts [String] :query Search By Name # @option opts [String] :parent_folder_id Filter By Folder Id # @option opts [Integer] :page Default: 1 # @option opts [Integer] :per_page Default: 50 # @return [Array