From b756b1e8b8715cbcd2900a44f40b90ccb2790000 Mon Sep 17 00:00:00 2001 From: Anna Velentsevich Date: Fri, 13 Dec 2024 14:46:24 +0100 Subject: [PATCH] add checkes on successful result --- spec/services/invoice_custom_sections/deselect_service_spec.rb | 1 + spec/services/invoice_custom_sections/update_service_spec.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/spec/services/invoice_custom_sections/deselect_service_spec.rb b/spec/services/invoice_custom_sections/deselect_service_spec.rb index 0bbc533409f..fa225cd43b1 100644 --- a/spec/services/invoice_custom_sections/deselect_service_spec.rb +++ b/spec/services/invoice_custom_sections/deselect_service_spec.rb @@ -14,6 +14,7 @@ it 'selects the section for the organization' do expect { service_result }.to change(organization.selected_invoice_custom_sections, :count).from(1).to(0) + expect(service_result).to be_success expect(organization.selected_invoice_custom_sections).to eq([]) end end diff --git a/spec/services/invoice_custom_sections/update_service_spec.rb b/spec/services/invoice_custom_sections/update_service_spec.rb index 337aa41b9d2..594b8e1a417 100644 --- a/spec/services/invoice_custom_sections/update_service_spec.rb +++ b/spec/services/invoice_custom_sections/update_service_spec.rb @@ -20,6 +20,7 @@ it 'updates the invoice custom section' do result = service_result + expect(result).to be_success expect(result.invoice_custom_section.name).to eq('Updated Name') expect(InvoiceCustomSections::SelectService).to have_received(:call) .with(section: invoice_custom_section, organization: organization)