diff --git a/db/migrate/20241227154337_add_code_uniqueness_constraint_on_invoice_custom_sections.rb b/db/migrate/20241227154337_remove_code_uniqueness_constraint_on_invoice_custom_sections.rb similarity index 67% rename from db/migrate/20241227154337_add_code_uniqueness_constraint_on_invoice_custom_sections.rb rename to db/migrate/20241227154337_remove_code_uniqueness_constraint_on_invoice_custom_sections.rb index e444ad43fc7..56530d2859f 100644 --- a/db/migrate/20241227154337_add_code_uniqueness_constraint_on_invoice_custom_sections.rb +++ b/db/migrate/20241227154337_remove_code_uniqueness_constraint_on_invoice_custom_sections.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class AddCodeUniquenessConstraintOnInvoiceCustomSections < ActiveRecord::Migration[7.1] +class RemoveCodeUniquenessConstraintOnInvoiceCustomSections < ActiveRecord::Migration[7.1] disable_ddl_transaction! def change diff --git a/spec/graphql/mutations/customers/update_spec.rb b/spec/graphql/mutations/customers/update_spec.rb index b9dfe816946..138fbe5d6c7 100644 --- a/spec/graphql/mutations/customers/update_spec.rb +++ b/spec/graphql/mutations/customers/update_spec.rb @@ -10,7 +10,7 @@ let(:stripe_provider) { create(:stripe_provider, organization:) } let(:tax) { create(:tax, organization:) } let(:external_id) { SecureRandom.uuid } - let(:invoice_custom_sections) { create_list(:invoice_custom_section, 3, organization:) } + let(:invoice_custom_sections) { create_list(:invoice_custom_section, 2, organization:) } let(:mutation) do <<~GQL @@ -76,7 +76,7 @@ } ], taxCodes: [tax.code], - applicableInvoiceCustomSectionIds: invoice_custom_sections[0..1].map(&:id) + applicableInvoiceCustomSectionIds: invoice_custom_sections.map(&:id) } end @@ -132,7 +132,7 @@ expect(result_data['billingConfiguration']['id']).to eq("#{customer.id}-c0nf") expect(result_data['metadata'][0]['key']).to eq('test-key') expect(result_data['taxes'][0]['code']).to eq(tax.code) - expect(result_data['applicableInvoiceCustomSections']).to match_array(invoice_custom_sections[0..1].map { |section| {'id' => section.id} }) + expect(result_data['applicableInvoiceCustomSections']).to match_array(invoice_custom_sections.map { |section| {'id' => section.id} }) end end diff --git a/spec/graphql/resolvers/customer_resolver_spec.rb b/spec/graphql/resolvers/customer_resolver_spec.rb index 05e60f0100a..288f607ab4b 100644 --- a/spec/graphql/resolvers/customer_resolver_spec.rb +++ b/spec/graphql/resolvers/customer_resolver_spec.rb @@ -115,7 +115,7 @@ end end - context 'when customer has invoice_custom_sections nested from organization ' do + context 'when customer has invoice_custom_sections selected on organization level' do before do customer.selected_invoice_custom_sections = [] end