Skip to content

Business intelligence made simple

Improved checks index code and test [skip ci]

Andrew Kane56ed3ace509d
diff --git a/app/views/blazer/checks/index.html.erb b/app/views/blazer/checks/index.html.erb
index 72157ad8..557bba38 100644
--- a/app/views/blazer/checks/index.html.erb
+++ b/app/views/blazer/checks/index.html.erb
@@ -45,10 +45,8 @@
<td><%= check.schedule if check.respond_to?(:schedule) %></td>
<td>
<ul class="list-unstyled" style="margin-bottom: 0; word-break: break-all;">
- <% Blazer.notifiers.each do |notifier| %>
- <% notifier.notify_list(check).each do |item| %>
- <li><%= item %></li>
- <% end %>
+ <% Blazer.notifiers.flat_map { |n| n.notify_list(check) }.each do |item| %>
+ <li><%= item %></li>
<% end %>
</ul>
</td>
diff --git a/test/checks_test.rb b/test/checks_test.rb
index ca56b901..d6c47081 100644
--- a/test/checks_test.rb
+++ b/test/checks_test.rb
@@ -8,10 +8,11 @@ class ChecksTest < ActionDispatch::IntegrationTest
def test_index
query = create_query
- create_check(query: query, check_type: "bad_data")
+ create_check(query: query, check_type: "bad_data", emails: "[email protected]")
get blazer.checks_path
assert_response :success
+ assert_match "[email protected]", response.body
end
def test_index_q