diff options
Diffstat (limited to 'spec/models/internal_id_spec.rb')
-rw-r--r-- | spec/models/internal_id_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/models/internal_id_spec.rb b/spec/models/internal_id_spec.rb index 981245627af..390d1552c16 100644 --- a/spec/models/internal_id_spec.rb +++ b/spec/models/internal_id_spec.rb @@ -100,7 +100,8 @@ RSpec.describe InternalId do context 'when executed outside of transaction' do it 'increments counter with in_transaction: "false"' do - expect(ActiveRecord::Base.connection).to receive(:transaction_open?) { false } + allow(ActiveRecord::Base.connection).to receive(:transaction_open?) { false } + expect(InternalId::InternalIdGenerator.internal_id_transactions_total).to receive(:increment) .with(operation: :generate, usage: 'issues', in_transaction: 'false').and_call_original @@ -158,7 +159,8 @@ RSpec.describe InternalId do let(:value) { 2 } it 'increments counter with in_transaction: "false"' do - expect(ActiveRecord::Base.connection).to receive(:transaction_open?) { false } + allow(ActiveRecord::Base.connection).to receive(:transaction_open?) { false } + expect(InternalId::InternalIdGenerator.internal_id_transactions_total).to receive(:increment) .with(operation: :reset, usage: 'issues', in_transaction: 'false').and_call_original @@ -228,7 +230,8 @@ RSpec.describe InternalId do context 'when executed outside of transaction' do it 'increments counter with in_transaction: "false"' do - expect(ActiveRecord::Base.connection).to receive(:transaction_open?) { false } + allow(ActiveRecord::Base.connection).to receive(:transaction_open?) { false } + expect(InternalId::InternalIdGenerator.internal_id_transactions_total).to receive(:increment) .with(operation: :track_greatest, usage: 'issues', in_transaction: 'false').and_call_original |