diff --git a/app/domain/invoices/abacus/sales_order.rb b/app/domain/invoices/abacus/sales_order.rb index 910963657..40b82c99d 100644 --- a/app/domain/invoices/abacus/sales_order.rb +++ b/app/domain/invoices/abacus/sales_order.rb @@ -53,7 +53,7 @@ def full_attrs def sales_order_attrs { # customer id is defined to be the same as subject id - customer_id: entity.person.reload.abacus_subject_key, + customer_id: entity.person.abacus_subject_key, order_date: entity.issued_at, delivery_date: entity.sent_at, total_amount: entity.total.to_f, diff --git a/spec/abilities/json_api/external_invoice_ability_spec.rb b/spec/abilities/json_api/external_invoice_ability_spec.rb index 9bd558728..fbd4320e6 100644 --- a/spec/abilities/json_api/external_invoice_ability_spec.rb +++ b/spec/abilities/json_api/external_invoice_ability_spec.rb @@ -19,6 +19,10 @@ group: groups(:bluemlisalp_funktionaere)).person end + before do + external_invoices(:external_invoice_draft).destroy! + end + context "index" do def accessible_by(user) ExternalInvoice.accessible_by(described_class.new(user)) diff --git a/spec/abilities/token_ability_spec.rb b/spec/abilities/token_ability_spec.rb index 3ac082210..0ab4b3c0c 100644 --- a/spec/abilities/token_ability_spec.rb +++ b/spec/abilities/token_ability_spec.rb @@ -15,6 +15,10 @@ let(:ability) { TokenAbility.new(token) } + before do + external_invoices(:external_invoice_draft).destroy! + end + describe "index_external_invoices on Group" do context :root do let(:token) { service_tokens(:permitted_root_layer_token) } diff --git a/spec/resources/external_invoice/reads_spec.rb b/spec/resources/external_invoice/reads_spec.rb index 91ddf3f57..dd059efc0 100644 --- a/spec/resources/external_invoice/reads_spec.rb +++ b/spec/resources/external_invoice/reads_spec.rb @@ -30,6 +30,10 @@ ] end + before do + external_invoices(:external_invoice_draft).destroy! + end + it "serializes expected attributes" do render data = jsonapi_data[0]