From cb4ff1b424df895cbf850be5823aa2dd9106d14f Mon Sep 17 00:00:00 2001 From: Luis Blanco Date: Thu, 11 Jul 2024 12:59:03 +0100 Subject: [PATCH] lint --- spec/services/ale_spec.rb | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/spec/services/ale_spec.rb b/spec/services/ale_spec.rb index 02b8ba5..9686e50 100644 --- a/spec/services/ale_spec.rb +++ b/spec/services/ale_spec.rb @@ -35,23 +35,23 @@ it { should_not be_listening } end end +end - describe 'Redborder-ale is registered in consul' do - if service_status == 'enabled' - describe "#{service} Registered in consul" do - service_json_cluster = command("curl -s #{api_endpoint}/catalog/service/#{service} | jq -c 'group_by(.ID)[]'") - service_json_cluster = service_json_cluster.stdout.chomp.split("\n") - it "API response for #{service} should not be empty" do - expect(service_json_cluster).not_to be_empty - end - health_cluster = command("curl -s #{api_endpoint}/health/service/#{service} | jq -r '.[].Checks[0].Status'") - health_cluster = health_cluster.stdout.chomp.split("\n") - service_and_health = service_json_cluster.zip(health_cluster) - service_and_health.each do |service, health| - it 'Should be registered and enabled' do - registered = JSON.parse(service)[0].key?('Address') && health == 'passing' # ? true : false - expect(registered).to be true - end +describe 'Redborder-ale is registered in consul' do + if service_status == 'enabled' + describe "#{service} Registered in consul" do + service_json_cluster = command("curl -s #{api_endpoint}/catalog/service/#{service} | jq -c 'group_by(.ID)[]'") + service_json_cluster = service_json_cluster.stdout.chomp.split("\n") + it "API response for #{service} should not be empty" do + expect(service_json_cluster).not_to be_empty + end + health_cluster = command("curl -s #{api_endpoint}/health/service/#{service} | jq -r '.[].Checks[0].Status'") + health_cluster = health_cluster.stdout.chomp.split("\n") + service_and_health = service_json_cluster.zip(health_cluster) + service_and_health.each do |service, health| + it 'Should be registered and enabled' do + registered = JSON.parse(service)[0].key?('Address') && health == 'passing' # ? true : false + expect(registered).to be true end end end