From ea397ffdfbc1ee43ad746efb69b569e06b4873ce Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Mon, 3 Aug 2015 18:58:32 +0200 Subject: Add connection test for pods in the network * add a class for checking pod connectivity * extend pod model to handle new functionality * add an admin frontend to list pods and re-trigger checks manually * add a daily worker to run through all the pods * add unit tests for most of the new code --- spec/workers/recurring_pod_check_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spec/workers/recurring_pod_check_spec.rb (limited to 'spec/workers') diff --git a/spec/workers/recurring_pod_check_spec.rb b/spec/workers/recurring_pod_check_spec.rb new file mode 100644 index 000000000..b7f240f1e --- /dev/null +++ b/spec/workers/recurring_pod_check_spec.rb @@ -0,0 +1,17 @@ + +require "spec_helper" + +describe Workers::RecurringPodCheck do + before do + @pods = (0..4).map do + FactoryGirl.create(:pod).tap { |pod| + expect(pod).to receive(:test_connection!) + } + end + allow(Pod).to receive(:find_in_batches) { @pods } + end + + it "performs a connection test on all existing pods" do + Workers::RecurringPodCheck.new.perform + end +end -- cgit v1.2.3