From 219eead23f9feb5da9ec378c451d773aea2dfe61 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 10 Mar 2020 18:08:17 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/models/concerns/bulk_insertable_associations_spec.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'spec/models/concerns/bulk_insertable_associations_spec.rb') diff --git a/spec/models/concerns/bulk_insertable_associations_spec.rb b/spec/models/concerns/bulk_insertable_associations_spec.rb index 9e584417697..6359b2c57ef 100644 --- a/spec/models/concerns/bulk_insertable_associations_spec.rb +++ b/spec/models/concerns/bulk_insertable_associations_spec.rb @@ -57,16 +57,12 @@ describe BulkInsertableAssociations do end end - before do - ActiveRecord::Base.connection.execute('TRUNCATE bulk_foos RESTART IDENTITY') - end - context 'saving bulk insertable associations' do let(:parent) { BulkParent.new(name: 'parent') } context 'when items already have IDs' do it 'stores nothing and raises an error' do - build_items(parent: parent) { |n, item| item.id = 100 + n } + build_items(parent: parent) { |n, item| item.id = n } expect { save_with_bulk_inserts(parent) }.to raise_error(BulkInsertSafe::PrimaryKeySetError) expect(BulkFoo.count).to eq(0) @@ -79,7 +75,7 @@ describe BulkInsertableAssociations do expect(BulkFoo).to receive(:bulk_insert!).once.and_call_original expect { save_with_bulk_inserts(parent) }.to change { BulkFoo.count }.from(0).to(items.size) - expect(parent.bulk_foos.pluck(:id)).to contain_exactly(*(1..10)) + expect(parent.bulk_foos.pluck(:id)).to all(be_a Integer) end end -- cgit v1.2.1