From a9e8ee83a44842efaa3dfbb0176e87dfeecf8a38 Mon Sep 17 00:00:00 2001 From: Yuri Rudman Date: Thu, 25 Jan 2018 14:29:49 -0500 Subject: [PATCH] added test when error raised inside PglogicalSubscription#backlog --- spec/models/pglogical_subscription_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/models/pglogical_subscription_spec.rb b/spec/models/pglogical_subscription_spec.rb index 81d894a700b..b967868f2a6 100644 --- a/spec/models/pglogical_subscription_spec.rb +++ b/spec/models/pglogical_subscription_spec.rb @@ -423,5 +423,11 @@ expect(described_class.first.backlog).to eq(12_120) end + + it "returns nill if error raised inside" do + expect(MiqRegionRemote).to receive(:with_remote_connection).and_raise(PG::Error) + + expect(described_class.first.backlog).to be nil + end end end