Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ljblancoredborder committed Jul 11, 2024
1 parent 6b0d66c commit cb4ff1b
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions spec/services/ale_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb4ff1b

Please sign in to comment.