popular/missed searches: fix blank views.
Fix missing call to `.each`.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @search_service.missed_search_rankings do |tags, count| %>
|
<% @search_service.missed_search_rankings.each do |tags, count| %>
|
||||||
<tr class="tag-type-<%= Tag.category_for(tags) %>">
|
<tr class="tag-type-<%= Tag.category_for(tags) %>">
|
||||||
<td><%= link_to tags, posts_path(:tags => tags) %></td>
|
<td><%= link_to tags, posts_path(:tags => tags) %></td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @search_service.post_search_rankings(@date) do |tags, count| %>
|
<% @search_service.post_search_rankings(@date).each do |tags, count| %>
|
||||||
<tr class="tag-type-<%= Tag.category_for(tags) %>">
|
<tr class="tag-type-<%= Tag.category_for(tags) %>">
|
||||||
<td><%= link_to tags, posts_path(:tags => tags) %></td>
|
<td><%= link_to tags, posts_path(:tags => tags) %></td>
|
||||||
<td style="text-align: right;"><%= count.to_i %></td>
|
<td style="text-align: right;"><%= count.to_i %></td>
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ module Explore
|
|||||||
mock_post_search_rankings(Date.today, [["1girl", 100], ["original", 50]])
|
mock_post_search_rankings(Date.today, [["1girl", 100], ["original", 50]])
|
||||||
get searches_explore_posts_path
|
get searches_explore_posts_path
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
assert_select "tbody tr", count: 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -49,6 +50,7 @@ module Explore
|
|||||||
mock_missed_search_rankings([["1girl", 100], ["original", 50]])
|
mock_missed_search_rankings([["1girl", 100], ["original", 50]])
|
||||||
get missed_searches_explore_posts_path
|
get missed_searches_explore_posts_path
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
assert_select "tbody tr", count: 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ module ReportbooruHelper
|
|||||||
def mock_missed_search_rankings(date = Date.today, rankings)
|
def mock_missed_search_rankings(date = Date.today, rankings)
|
||||||
Danbooru.config.stubs(:reportbooru_server).returns("http://localhost:1234")
|
Danbooru.config.stubs(:reportbooru_server).returns("http://localhost:1234")
|
||||||
url = "http://localhost:1234/missed_searches"
|
url = "http://localhost:1234/missed_searches"
|
||||||
mock_request(url, body: rankings.to_json)
|
data = rankings.map { _1.join(" ") }.join("\n")
|
||||||
|
mock_request(url, body: data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def mock_post_view_rankings(date = Date.today, rankings)
|
def mock_post_view_rankings(date = Date.today, rankings)
|
||||||
|
|||||||
Reference in New Issue
Block a user