Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 8ee3e0f

Browse files
author
Derik Evangelista
committed
v3(bindings): fix flaky test
1 parent 14f6717 commit 8ee3e0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/unit/models/services/service_binding_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def new_model
470470
expect(binding.last_operation.state).to eq 'in progress'
471471
expect(binding.last_operation.description).to eq '10%'
472472
expect(binding.last_operation.type).to eq 'create'
473-
expect(ServiceBinding.count).to eq(1)
473+
expect(ServiceBinding.where(guid: binding.guid).count).to eq(1)
474474
end
475475

476476
context 'when saving the binding operation fails' do
@@ -480,7 +480,7 @@ def new_model
480480

481481
it 'should rollback the binding' do
482482
expect { binding.save_with_new_operation({ state: 'will fail' }) }.to raise_error(Sequel::DatabaseError)
483-
expect(ServiceBinding.count).to eq(0)
483+
expect(ServiceBinding.where(guid: binding.guid).count).to eq(0)
484484
end
485485
end
486486

@@ -492,8 +492,8 @@ def new_model
492492
expect(binding.last_operation.state).to eq 'in progress'
493493
expect(binding.last_operation.type).to eq 'delete'
494494
expect(binding.last_operation.description).to eq nil
495-
expect(ServiceBinding.count).to eq(1)
496-
expect(ServiceBindingOperation.count).to eq(1)
495+
expect(ServiceBinding.where(guid: binding.guid).count).to eq(1)
496+
expect(ServiceBindingOperation.where(service_binding_id: binding.id).count).to eq(1)
497497
end
498498
end
499499

0 commit comments

Comments
 (0)