diff --git a/spec/models/pglogical_subscription_spec.rb b/spec/models/pglogical_subscription_spec.rb index d8a47b3da6ba..b9e5ba594672 100644 --- a/spec/models/pglogical_subscription_spec.rb +++ b/spec/models/pglogical_subscription_spec.rb @@ -496,5 +496,12 @@ expect(described_class.first.backlog).to be nil end + + it 'does not attempt to calculate backlog and returns nil unless subscription status is "replicating"' do + allow(described_class).to receive(:status).and_return("down") + + expect(remote_connection).not_to receive(:xlog_location) + expect(described_class.first.backlog).to be nil + end end end