From f4fbaa78f51463d5719682b7cbbdc10795e8f645 Mon Sep 17 00:00:00 2001 From: Mauro Valota Date: Mon, 17 Aug 2026 16:16:08 +0200 Subject: [PATCH 1/2] removed ostruct from tests --- fattureincloud_ruby_sdk.gemspec | 1 - spec/api/archive_api_spec.rb | 5 ----- spec/api/cashbook_api_spec.rb | 4 ---- spec/api/clients_api_spec.rb | 4 ---- spec/api/companies_api_spec.rb | 1 - spec/api/emails_api_spec.rb | 1 - spec/api/info_api_spec.rb | 16 ---------------- spec/api/issued_documents_api_spec.rb | 11 ----------- spec/api/issued_e_invoices_api_spec.rb | 3 --- spec/api/price_lists_api_spec.rb | 2 -- spec/api/products_api_spec.rb | 4 ---- spec/api/receipts_api_spec.rb | 6 ------ spec/api/received_documents_api_spec.rb | 8 -------- spec/api/settings_api_spec.rb | 10 ---------- spec/api/suppliers_api_spec.rb | 4 ---- spec/api/taxes_api_spec.rb | 5 ----- spec/api/user_api_spec.rb | 2 -- spec/api/webhooks_api_spec.rb | 4 ---- spec/spec_helper.rb | 1 - 19 files changed, 92 deletions(-) diff --git a/fattureincloud_ruby_sdk.gemspec b/fattureincloud_ruby_sdk.gemspec index be9ea6af..e0910ad9 100644 --- a/fattureincloud_ruby_sdk.gemspec +++ b/fattureincloud_ruby_sdk.gemspec @@ -28,7 +28,6 @@ Gem::Specification.new do |s| s.metadata = {} s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_dependency 'ostruct', '~> 0.6' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' diff --git a/spec/api/archive_api_spec.rb b/spec/api/archive_api_spec.rb index f262beaf..bbbbf4ca 100644 --- a/spec/api/archive_api_spec.rb +++ b/spec/api/archive_api_spec.rb @@ -58,7 +58,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-20", "category": "Altri documenti", "description": "spesa 1", "attachment_token": "YjFrbmNlc3E0NmNuaW5ocXQ0b2p0c202NG1ncWx6ZmsvZmlsZW5hbWU" } } response = @api_instance.create_archive_document(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_archive_document_response_obj.to_json actual_json = response.to_json @@ -91,7 +90,6 @@ describe 'get_archive_document test' do it 'should work' do response = @api_instance.get_archive_document(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_archive_document_response_obj.to_json actual_json = response.to_json @@ -114,7 +112,6 @@ describe 'list_archive_documents test' do it 'should work' do response = @api_instance.list_archive_documents(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_archive_documents_response_obj.to_json actual_json = response.to_json @@ -133,7 +130,6 @@ describe 'modify_archive_document test' do it 'should work' do response = @api_instance.modify_archive_document(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_archive_document_response_obj.to_json actual_json = response.to_json @@ -153,7 +149,6 @@ it 'should work' do opts = {} response = @api_instance.upload_archive_document_attachment(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @upload_archive_document_attachment_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/cashbook_api_spec.rb b/spec/api/cashbook_api_spec.rb index 8471f259..a1f2e6a8 100644 --- a/spec/api/cashbook_api_spec.rb +++ b/spec/api/cashbook_api_spec.rb @@ -56,7 +56,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } } response = @api_instance.create_cashbook_entry(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_cashbook_entry_response_obj.to_json actual_json = response.to_json @@ -89,7 +88,6 @@ describe 'get_cashbook_entry test' do it 'should work' do response = @api_instance.get_cashbook_entry(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_cashbook_entry_response_obj.to_json actual_json = response.to_json @@ -111,7 +109,6 @@ describe 'list_cashbook_entries test' do it 'should work' do response = @api_instance.list_cashbook_entries(2, "2020-12-12", "2021-12-12") - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_cashbook_entries_response_obj.to_json actual_json = response.to_json @@ -131,7 +128,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } } response = @api_instance.modify_cashbook_entry(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_cashbook_entry_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/clients_api_spec.rb b/spec/api/clients_api_spec.rb index 9c41ddef..398b8508 100644 --- a/spec/api/clients_api_spec.rb +++ b/spec/api/clients_api_spec.rb @@ -56,7 +56,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } } response = @api_instance.create_client(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_client_response_obj.to_json actual_json = response.to_json @@ -89,7 +88,6 @@ describe 'get_client test' do it 'should work' do response = @api_instance.get_client(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_client_response_obj.to_json actual_json = response.to_json @@ -112,7 +110,6 @@ describe 'list_clients test' do it 'should work' do response = @api_instance.list_clients(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_clients_response_obj.to_json actual_json = response.to_json @@ -132,7 +129,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } } response = @api_instance.modify_client(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_client_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/companies_api_spec.rb b/spec/api/companies_api_spec.rb index 456ac1d8..b081375f 100644 --- a/spec/api/companies_api_spec.rb +++ b/spec/api/companies_api_spec.rb @@ -44,7 +44,6 @@ describe 'get_company_info test' do it 'should work' do response = @api_instance.get_company_info(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_company_info_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/emails_api_spec.rb b/spec/api/emails_api_spec.rb index d92469e4..2ed2b367 100644 --- a/spec/api/emails_api_spec.rb +++ b/spec/api/emails_api_spec.rb @@ -45,7 +45,6 @@ describe 'list_emails test' do it 'should work' do response = @api_instance.list_emails(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_emails_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/info_api_spec.rb b/spec/api/info_api_spec.rb index 92ebaff9..3b3466bc 100644 --- a/spec/api/info_api_spec.rb +++ b/spec/api/info_api_spec.rb @@ -89,7 +89,6 @@ describe 'list_archive_categories test' do it 'should work' do response = @api_instance.list_archive_categories(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_archive_categories_response_obj.to_json actual_json = response.to_json @@ -107,7 +106,6 @@ describe 'list_cities test' do it 'should work' do response = @api_instance.list_cities(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_cities_response_obj.to_json actual_json = response.to_json @@ -124,7 +122,6 @@ describe 'list_cost_centers test' do it 'should work' do response = @api_instance.list_cost_centers(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_cost_centers_response_obj.to_json actual_json = response.to_json @@ -140,7 +137,6 @@ describe 'list_countries test' do it 'should work' do response = @api_instance.list_countries(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_countries_response_obj.to_json actual_json = response.to_json @@ -156,7 +152,6 @@ describe 'list_detailed_countries test' do it 'should work' do response = @api_instance.list_detailed_countries(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_detailed_countries_response_obj.to_json actual_json = response.to_json @@ -172,7 +167,6 @@ describe 'list_currencies test' do it 'should work' do response = @api_instance.list_currencies(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_currencies_response_obj.to_json actual_json = response.to_json @@ -188,7 +182,6 @@ describe 'list_delivery_notes_default_causals test' do it 'should work' do response = @api_instance.list_delivery_notes_default_causals(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_delivery_notes_default_causals_response_obj.to_json actual_json = response.to_json @@ -204,7 +197,6 @@ describe 'list_languages test' do it 'should work' do response = @api_instance.list_languages(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_languages_response_obj.to_json actual_json = response.to_json @@ -224,7 +216,6 @@ describe 'list_payment_accounts test' do it 'should work' do response = @api_instance.list_payment_accounts(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_payment_accounts_response_obj.to_json actual_json = response.to_json @@ -244,7 +235,6 @@ describe 'list_payment_methods test' do it 'should work' do response = @api_instance.list_payment_methods(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_payment_methods_response_obj.to_json actual_json = response.to_json @@ -262,7 +252,6 @@ describe 'list_product_categories test' do it 'should work' do response = @api_instance.list_product_categories(2, "issued_documents") - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_product_categories_response_obj.to_json actual_json = response.to_json @@ -279,7 +268,6 @@ describe 'list_received_document_categories test' do it 'should work' do response = @api_instance.list_received_document_categories(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_received_document_categories_response_obj.to_json actual_json = response.to_json @@ -296,7 +284,6 @@ describe 'list_revenue_centers test' do it 'should work' do response = @api_instance.list_revenue_centers(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_revenue_centers_response_obj.to_json actual_json = response.to_json @@ -314,7 +301,6 @@ describe 'list_default_templates test' do it 'should work' do response = @api_instance.list_default_templates(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_templates_response_obj.to_json actual_json = response.to_json @@ -330,7 +316,6 @@ describe 'list_units_of_measure test' do it 'should work' do response = @api_instance.list_units_of_measure(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_units_of_measure_response_obj.to_json actual_json = response.to_json @@ -348,7 +333,6 @@ describe 'list_vat_types test' do it 'should work' do response = @api_instance.list_vat_types(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_vat_types_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/issued_documents_api_spec.rb b/spec/api/issued_documents_api_spec.rb index 1f19d70f..e92df1a2 100644 --- a/spec/api/issued_documents_api_spec.rb +++ b/spec/api/issued_documents_api_spec.rb @@ -76,7 +76,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } } response = @api_instance.create_issued_document(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_issued_document_response_obj.to_json actual_json = response.to_json @@ -120,7 +119,6 @@ describe 'get_email_data test' do it 'should work' do response = @api_instance.get_email_data(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_email_data_response_obj.to_json actual_json = response.to_json @@ -139,7 +137,6 @@ describe 'get_existing_issued_document_totals test' do it 'should work' do response = @api_instance.get_existing_issued_document_totals(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_existing_issued_document_totals_response_obj.to_json actual_json = response.to_json @@ -159,7 +156,6 @@ describe 'get_issued_document test' do it 'should work' do response = @api_instance.get_issued_document(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_issued_document_response_obj.to_json actual_json = response.to_json @@ -177,7 +173,6 @@ describe 'get_issued_document_pre_create_info test' do it 'should work' do response = @api_instance.get_issued_document_pre_create_info(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_issued_document_pre_create_info_response_obj.to_json actual_json = response.to_json @@ -196,7 +191,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } } response = @api_instance.get_new_issued_document_totals(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_new_issued_document_totals_response_obj.to_json actual_json = response.to_json @@ -220,7 +214,6 @@ describe 'list_issued_documents test' do it 'should work' do response = @api_instance.list_issued_documents(2, "invoices") - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_issued_documents_response_obj.to_json actual_json = response.to_json @@ -240,7 +233,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-24", "amount_in": 122, "payment_account_in": { "id": 21 }, "description": "Fattura n. 201\/2021", "entity_name": "Rossi S.r.l.", "kind": "issued_document", "document": { "id": 54321 }, "type": "in" } } response = @api_instance.modify_issued_document(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_issued_document_response_obj.to_json actual_json = response.to_json @@ -273,7 +265,6 @@ describe 'upload_issued_document_attachment test' do it 'should work' do response = @api_instance.upload_issued_document_attachment(2, {}) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @upload_issued_document_attachment_response_obj.to_json actual_json = response.to_json @@ -286,7 +277,6 @@ describe 'transform_issued_document test' do it 'should work' do response = @api_instance.transform_issued_document(2, 54321, "proforma") - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @transform_issued_document_response_obj.to_json actual_json = response.to_json @@ -299,7 +289,6 @@ describe 'join_issued_documents test' do it 'should work' do response = @api_instance.join_issued_documents(2, {}) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @join_issued_documents_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/issued_e_invoices_api_spec.rb b/spec/api/issued_e_invoices_api_spec.rb index 1dfc5876..545d22e0 100644 --- a/spec/api/issued_e_invoices_api_spec.rb +++ b/spec/api/issued_e_invoices_api_spec.rb @@ -56,7 +56,6 @@ describe 'send_e_invoice test' do it 'should work' do response = @api_instance.send_e_invoice(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @send_e_invoice_response_obj.to_json actual_json = response.to_json @@ -74,7 +73,6 @@ describe 'verify_e_invoice_xml test' do it 'should work' do response = @api_instance.verify_e_invoice_xml(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @verify_e_invoice_xml_response_obj.to_json actual_json = response.to_json @@ -109,7 +107,6 @@ describe 'get_e_invoice_rejection_reason test' do it 'should work' do response = @api_instance.get_e_invoice_rejection_reason(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_e_invoice_rejection_reason_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/price_lists_api_spec.rb b/spec/api/price_lists_api_spec.rb index ef57c898..151f0b87 100644 --- a/spec/api/price_lists_api_spec.rb +++ b/spec/api/price_lists_api_spec.rb @@ -49,7 +49,6 @@ describe 'get_price_list_items test' do it 'should work' do response = @api_instance.get_price_list_items(2, '10') - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_price_list_items_response_obj.to_json actual_json = response.to_json @@ -66,7 +65,6 @@ describe 'get_price_lists test' do it 'should work' do response = @api_instance.get_price_lists(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_price_lists_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/products_api_spec.rb b/spec/api/products_api_spec.rb index c661c8dd..61b5b643 100644 --- a/spec/api/products_api_spec.rb +++ b/spec/api/products_api_spec.rb @@ -56,7 +56,6 @@ it 'should work' do opts = { "data": { "name": "Tavolo di marmo", "code": "TAVOLOso003", "net_price": 240, "gross_price": 280, "use_gross_price": false, "net_cost": 0, "measure": "", "description": "Tavolo in marmo pregiato", "category": "arredamento", "in_stock": true, "default_vat": { "id": 1409, "value": 22, "description": "Non imponibile art. 123", "notes": "IVA non imponibile ai sensi dell'articolo 123, comma 2", "is_disabled": false } } } response = @api_instance.create_product(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_product_response_obj.to_json actual_json = response.to_json @@ -89,7 +88,6 @@ describe 'get_product test' do it 'should work' do response = @api_instance.get_product(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_product_response_obj.to_json actual_json = response.to_json @@ -112,7 +110,6 @@ describe 'list_products test' do it 'should work' do response = @api_instance.list_products(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_products_response_obj.to_json actual_json = response.to_json @@ -132,7 +129,6 @@ it 'should work' do opts = { "data": { "name": "Tavolo di marmo", "code": "TAVOLOso003", "net_price": 240, "gross_price": 280, "use_gross_price": false, "net_cost": 0, "measure": "", "description": "Tavolo in marmo pregiato", "category": "arredamento", "in_stock": true, "default_vat": { "id": 1409, "value": 22, "description": "Non imponibile art. 123", "notes": "IVA non imponibile ai sensi dell'articolo 123, comma 2", "is_disabled": false } } } response = @api_instance.modify_product(2, 22, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_product_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/receipts_api_spec.rb b/spec/api/receipts_api_spec.rb index 4c9c0345..ba0b2538 100644 --- a/spec/api/receipts_api_spec.rb +++ b/spec/api/receipts_api_spec.rb @@ -62,7 +62,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-19", "number": 6, "numeration": "rreccc", "amount_net": 8.2, "amount_vat": 1.8, "amount_gross": 10, "use_gross_prices": true, "type": "sales_receipt", "description": "cassa 1", "rc_center": "", "payment_account": { "id": 21, "name": "contanti" }, "items_list": [{ "id": 888, "amount_net": 8.2, "amount_vat": 1.8, "amount_gross": 10, "category": "altro", "vat": { "id": 1409, "value": 22, "description": "iva" } }] } } response = @api_instance.create_receipt(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_receipt_response_obj.to_json actual_json = response.to_json @@ -95,7 +94,6 @@ describe 'get_receipt test' do it 'should work' do response = @api_instance.get_receipt(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_receipt_response_obj.to_json actual_json = response.to_json @@ -112,7 +110,6 @@ describe 'get_receipt_pre_create_info test' do it 'should work' do response = @api_instance.get_receipt_pre_create_info(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_receipt_pre_create_info_response_obj.to_json actual_json = response.to_json @@ -131,7 +128,6 @@ describe 'get_receipts_monthly_totals test' do it 'should work' do response = @api_instance.get_receipts_monthly_totals(2, "sales_receipt", 2021) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_receipts_monthly_totals_response_obj.to_json actual_json = response.to_json @@ -154,7 +150,6 @@ describe 'list_receipts test' do it 'should work' do response = @api_instance.list_receipts(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_receipts_response_obj.to_json actual_json = response.to_json @@ -174,7 +169,6 @@ it 'should work' do opts = { "data": { "date": "2021-08-19", "number": 6, "numeration": "rreccc", "amount_net": 8.2, "amount_vat": 1.8, "amount_gross": 10, "use_gross_prices": true, "type": "sales_receipt", "description": "cassa 1", "rc_center": "", "payment_account": { "id": 21, "name": "contanti" }, "items_list": [{ "id": 888, "amount_net": 8.2, "amount_vat": 1.8, "amount_gross": 10, "category": "altro", "vat": { "id": 1409, "value": 22, "description": "iva" } }] } } response = @api_instance.modify_receipt(2, 22, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_receipt_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/received_documents_api_spec.rb b/spec/api/received_documents_api_spec.rb index b61a1fbf..67a2d26a 100644 --- a/spec/api/received_documents_api_spec.rb +++ b/spec/api/received_documents_api_spec.rb @@ -68,7 +68,6 @@ it 'should work' do opts = { "data": { "type": "expense", "description": "Soggiorno di lavoro", "amortization": 1, "rc_center": "", "invoice_number": "", "is_marked": false, "is_detailed": false, "e_invoice": false, "entity": { "id": 111, "name": "Hotel Rubino Palace" }, "date": "2021-08-15", "next_due_date": "2021-08-15", "currency": { "id": "EUR", "exchange_rate": "1.00000", "symbol": "\u20ac" }, "amount_net": 592, "amount_vat": 0, "amount_gross": 592, "amount_withholding_tax": 0, "amount_other_withholding_tax": 0, "tax_deductibility": 50, "vat_deductibility": 100, "items_list": nil, "payments_list": [{ "amount": 592, "due_date": "2021-08-15", "paid_date": "2021-08-15", "id": 777, "payment_terms": { "days": 0, "type": "standard" }, "status": "paid", "payment_account": { "id": 21, "name": "Contanti", "virtual": false, "attachment_token": "N3RmNTYycGMzZTRob3JkNWg2Nzg2Ympscjd1bW00dDIvbm9tZV9maWxl" } }] } } response = @api_instance.create_received_document(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_received_document_response_obj.to_json actual_json = response.to_json @@ -113,7 +112,6 @@ describe 'get_existing_received_document_totals test' do it 'should work' do response = @api_instance.get_existing_received_document_totals(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_existing_received_document_totals_response_obj.to_json actual_json = response.to_json @@ -132,7 +130,6 @@ it 'should work' do opts = { "data": { "type": "expense", "description": "Soggiorno di lavoro", "amortization": 1, "rc_center": "", "invoice_number": "", "is_marked": false, "is_detailed": false, "e_invoice": false, "entity": { "id": 111, "name": "Hotel Rubino Palace" }, "date": "2021-08-15", "next_due_date": "2021-08-15", "currency": { "id": "EUR", "exchange_rate": "1.00000", "symbol": "\u20ac" }, "amount_net": 592, "amount_vat": 0, "amount_gross": 592, "amount_withholding_tax": 0, "amount_other_withholding_tax": 0, "tax_deductibility": 50, "vat_deductibility": 100, "items_list": nil, "payments_list": [{ "amount": 592, "due_date": "2021-08-15", "paid_date": "2021-08-15", "id": 777, "payment_terms": { "days": 0, "type": "standard" }, "status": "paid", "payment_account": { "id": 21, "name": "Contanti", "virtual": false, "attachment_token": "N3RmNTYycGMzZTRob3JkNWg2Nzg2Ympscjd1bW00dDIvbm9tZV9maWxl" } }] } } response = @api_instance.get_new_received_document_totals(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_new_received_document_totals_response_obj.to_json actual_json = response.to_json @@ -152,7 +149,6 @@ describe 'get_received_document test' do it 'should work' do response = @api_instance.get_received_document(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_received_document_response_obj.to_json actual_json = response.to_json @@ -170,7 +166,6 @@ describe 'get_received_document_pre_create_info test' do it 'should work' do response = @api_instance.get_received_document_pre_create_info(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_received_document_pre_create_info_response_obj.to_json actual_json = response.to_json @@ -194,7 +189,6 @@ describe 'list_received_documents test' do it 'should work' do response = @api_instance.list_received_documents(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_received_documents_response_obj.to_json actual_json = response.to_json @@ -214,7 +208,6 @@ it 'should work' do opts = { "data": { "type": "expense", "description": "Soggiorno di lavoro", "amortization": 1, "rc_center": "", "invoice_number": "", "is_marked": false, "is_detailed": false, "e_invoice": false, "entity": { "id": 111, "name": "Hotel Rubino Palace" }, "date": "2021-08-15", "next_due_date": "2021-08-15", "currency": { "id": "EUR", "exchange_rate": "1.00000", "symbol": "\u20ac" }, "amount_net": 592, "amount_vat": 0, "amount_gross": 592, "amount_withholding_tax": 0, "amount_other_withholding_tax": 0, "tax_deductibility": 50, "vat_deductibility": 100, "items_list": nil, "payments_list": [{ "amount": 592, "due_date": "2021-08-15", "paid_date": "2021-08-15", "id": 777, "payment_terms": { "days": 0, "type": "standard" }, "status": "paid", "payment_account": { "id": 21, "name": "Contanti", "virtual": false, "attachment_token": "N3RmNTYycGMzZTRob3JkNWg2Nzg2Ympscjd1bW00dDIvbm9tZV9maWxl" } }] } } response = @api_instance.modify_received_document(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_received_document_response_obj.to_json actual_json = response.to_json @@ -233,7 +226,6 @@ describe 'upload_received_document_attachment test' do it 'should work' do response = @api_instance.upload_received_document_attachment(2, {}) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @upload_received_document_attachment_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/settings_api_spec.rb b/spec/api/settings_api_spec.rb index 202a87aa..f8d43f75 100644 --- a/spec/api/settings_api_spec.rb +++ b/spec/api/settings_api_spec.rb @@ -74,7 +74,6 @@ it 'should work' do opts = { "data": { "name": "Indesa", "type": "bank", "iban": "IT17Q0051343200000003497636", "sia": "T1234", "virtual": false } } response = @api_instance.create_payment_account(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_payment_account_response_obj.to_json actual_json = response.to_json @@ -93,7 +92,6 @@ it 'should work' do opts = { "data": { "name": "Bonifico bancario", "is_default": true, "type": "standard", "details": [{ "title": "Banca", "description": "Sao Paulo" }], "default_payment_account": { "id": 12345, "name": "conto banca SP" } } } response = @api_instance.create_payment_method(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_payment_method_response_obj.to_json actual_json = response.to_json @@ -112,7 +110,6 @@ it 'should work' do opts = { "data": { "id": 0, "value": 22, "description": "Non imponibile art. 123", "notes": "IVA non imponibile ai sensi dell'articolo 123, comma 2", "e_invoice": true, "ei_type": 2, "ei_description": "string", "editable": true, "is_disabled": true } } response = @api_instance.create_vat_type(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_vat_type_response_obj.to_json actual_json = response.to_json @@ -171,7 +168,6 @@ describe 'get_payment_account test' do it 'should work' do response = @api_instance.get_payment_account(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_payment_account_response_obj.to_json actual_json = response.to_json @@ -191,7 +187,6 @@ describe 'get_payment_method test' do it 'should work' do response = @api_instance.get_payment_method(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_payment_method_response_obj.to_json actual_json = response.to_json @@ -209,7 +204,6 @@ describe 'get_vat_type test' do it 'should work' do response = @api_instance.get_vat_type(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_vat_type_response_obj.to_json actual_json = response.to_json @@ -229,7 +223,6 @@ it 'should work' do opts = { "data": { "name": "Indesa", "type": "bank", "iban": "IT17Q0051343200000003497636", "sia": "T1234", "virtual": false } } response = @api_instance.modify_payment_account(2, 22, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_payment_account_response_obj.to_json actual_json = response.to_json @@ -249,7 +242,6 @@ it 'should work' do opts = { "data": { "name": "Bonifico bancario", "is_default": true, "type": "standard", "details": [{ "title": "Banca", "description": "Sao Paulo" }], "default_payment_account": { "id": 12345, "name": "conto banca SP" } } } response = @api_instance.modify_payment_method(2, 22, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_payment_method_response_obj.to_json actual_json = response.to_json @@ -269,7 +261,6 @@ it 'should work' do opts = { "data": { "id": 0, "value": 22, "description": "Non imponibile art. 123", "notes": "IVA non imponibile ai sensi dell'articolo 123, comma 2", "e_invoice": true, "ei_type": 2, "ei_description": "string", "editable": true, "is_disabled": true } } response = @api_instance.modify_vat_type(2, 22, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_vat_type_response_obj.to_json actual_json = response.to_json @@ -286,7 +277,6 @@ describe 'get_tax_profile test' do it 'should work' do response = @api_instance.get_tax_profile(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_tax_profile_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/suppliers_api_spec.rb b/spec/api/suppliers_api_spec.rb index b086e089..7d5720aa 100644 --- a/spec/api/suppliers_api_spec.rb +++ b/spec/api/suppliers_api_spec.rb @@ -56,7 +56,6 @@ it 'should work' do opts = { "data": { "name": "Indesa", "type": "bank", "iban": "IT17Q0051343200000003497636", "sia": "T1234", "virtual": false } } response = @api_instance.create_supplier(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_supplier_response_obj.to_json actual_json = response.to_json @@ -89,7 +88,6 @@ describe 'get_supplier test' do it 'should work' do response = @api_instance.get_supplier(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_supplier_response_obj.to_json actual_json = response.to_json @@ -112,7 +110,6 @@ describe 'list_suppliers test' do it 'should work' do response = @api_instance.list_suppliers(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_suppliers_response_obj.to_json actual_json = response.to_json @@ -132,7 +129,6 @@ it 'should work' do opts = { "data": { "name": "Indesa", "type": "bank", "iban": "IT17Q0051343200000003497636", "sia": "T1234", "virtual": false } } response = @api_instance.modify_supplier(2, 22, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_supplier_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/taxes_api_spec.rb b/spec/api/taxes_api_spec.rb index a1e9c9f0..4aeb3fa9 100644 --- a/spec/api/taxes_api_spec.rb +++ b/spec/api/taxes_api_spec.rb @@ -59,7 +59,6 @@ it 'should work' do opts = { "data": { "amount": 840.36, "description": "PAGAMENTO IVA 2021", "due_date": "2021-12-31", "status": "paid", "payment_account": { "id": 21, "name": "Indesa - carta conto" } } } response = @api_instance.create_f24(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_f24_response_obj.to_json actual_json = response.to_json @@ -105,7 +104,6 @@ describe 'get_f24 test' do it 'should work' do response = @api_instance.get_f24(2, 22) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_f24_response_obj.to_json actual_json = response.to_json @@ -128,7 +126,6 @@ describe 'list_f24 test' do it 'should work' do response = @api_instance.list_f24(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_f24_response_obj.to_json actual_json = response.to_json @@ -148,7 +145,6 @@ it 'should work' do opts = { "data": { "amount": 840.36, "description": "PAGAMENTO IVA 2021", "due_date": "2021-12-31", "status": "paid", "payment_account": { "id": 21, "name": "Indesa - carta conto" } } } response = @api_instance.modify_f24(2, 22, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_f24_response_obj.to_json actual_json = response.to_json @@ -167,7 +163,6 @@ describe 'upload_f24_attachment test' do it 'should work' do response = @api_instance.upload_f24_attachment(2, {}) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @upload_f24_attachment_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/user_api_spec.rb b/spec/api/user_api_spec.rb index b7f34ed1..43fc880f 100644 --- a/spec/api/user_api_spec.rb +++ b/spec/api/user_api_spec.rb @@ -47,7 +47,6 @@ describe 'get_user_info test' do it 'should work' do response = @api_instance.get_user_info() - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_user_info_response_obj.to_json actual_json = response.to_json @@ -63,7 +62,6 @@ describe 'list_user_companies test' do it 'should work' do response = @api_instance.list_user_companies() - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_user_companies_response_obj.to_json actual_json = response.to_json diff --git a/spec/api/webhooks_api_spec.rb b/spec/api/webhooks_api_spec.rb index 65e3d974..6c34386d 100644 --- a/spec/api/webhooks_api_spec.rb +++ b/spec/api/webhooks_api_spec.rb @@ -56,7 +56,6 @@ it 'should work' do opts = { data: { sink: 'https://endpoint.test', types: ['it.fattureincloud.webhooks.cashbook.create'] } } response = @api_instance.create_webhooks_subscription(2, opts) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @create_webhooks_subscription_response_obj.to_json actual_json = response.to_json @@ -87,7 +86,6 @@ describe 'get_webhooks_subscription test' do it 'should work' do response = @api_instance.get_webhooks_subscription(2, "SUB123") - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @get_webhooks_subscription_response_obj.to_json actual_json = response.to_json @@ -104,7 +102,6 @@ describe 'list_webhooks_subscriptions test' do it 'should work' do response = @api_instance.list_webhooks_subscriptions(2) - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @list_webhooks_subscriptions_response_obj.to_json actual_json = response.to_json @@ -123,7 +120,6 @@ describe 'modify_webhooks_subscription test' do it 'should work' do response = @api_instance.modify_webhooks_subscription(2, "SUB123") - response_obj = JSON.parse(response.to_json, object_class: OpenStruct) expected_json = @modify_webhooks_subscription_response_obj.to_json actual_json = response.to_json diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 53208fbd..9af68ce9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,7 +11,6 @@ =end # load the gem -require 'ostruct' require 'fattureincloud_ruby_sdk' # The following was generated by the `rspec --init` command. Conventionally, all From c26cab5a0fba725c387daf7281758df48097d69f Mon Sep 17 00:00:00 2001 From: Mauro Valota Date: Mon, 17 Aug 2026 17:05:39 +0200 Subject: [PATCH 2/2] ci: using rspec --- .github/workflows/validate.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index f311dd54..1276d14a 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -26,4 +26,4 @@ jobs: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Run tests - run: bundle exec rake + run: bundle exec rspec