Fix budget investments chart in admin stats
The JavaScript required to display the chart wasn't loaded on the admin stats page. We're not adding a test because we're going to move the budgets graph to a different page on the pull request containing this commit. Note we're changing the "Go back" link, since using a turbolinks refresh broke this link when using the Chromium browser. Besides, there was an inconsistency where some of the "Go back" links in admin stats pointed to the admin stats page but other links pointed to `:back`.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<%= back_link_to %>
|
||||
<%= back_link_to admin_stats_path %>
|
||||
|
||||
<%= header %>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= back_link_to %>
|
||||
<%= back_link_to admin_stats_path %>
|
||||
|
||||
<h2><%= t("admin.stats.direct_messages.title") %></h2>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= back_link_to %>
|
||||
<%= back_link_to admin_stats_path %>
|
||||
|
||||
<h2 id="top"><%= t("admin.stats.polls.title") %></h2>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= back_link_to %>
|
||||
<%= back_link_to admin_stats_path %>
|
||||
|
||||
<h2><%= t("admin.stats.proposal_notifications.title") %></h2>
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<% content_for :head do %>
|
||||
<%= javascript_include_tag "stat_graphs", "data-turbolinks-track" => "reload" %>
|
||||
<% end %>
|
||||
|
||||
<div id="stats" class="stats">
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
|
||||
11
spec/components/admin/stats/sdg_component_spec.rb
Normal file
11
spec/components/admin/stats/sdg_component_spec.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Admin::Stats::SDGComponent do
|
||||
include Rails.application.routes.url_helpers
|
||||
|
||||
it "renders a links to go back to the admin stats index" do
|
||||
render_inline Admin::Stats::SDGComponent.new(SDG::Goal.all)
|
||||
|
||||
expect(page).to have_link "Go back", href: admin_stats_path
|
||||
end
|
||||
end
|
||||
@@ -183,6 +183,8 @@ describe "Stats", :admin do
|
||||
visit admin_stats_path
|
||||
click_link "Proposal notifications"
|
||||
|
||||
expect(page).to have_link "Go back", href: admin_stats_path
|
||||
|
||||
within("#proposal_notifications_count") do
|
||||
expect(page).to have_content "3"
|
||||
end
|
||||
@@ -232,6 +234,8 @@ describe "Stats", :admin do
|
||||
visit admin_stats_path
|
||||
click_link "Direct messages"
|
||||
|
||||
expect(page).to have_link "Go back", href: admin_stats_path
|
||||
|
||||
within("#direct_messages_count") do
|
||||
expect(page).to have_content "3"
|
||||
end
|
||||
@@ -253,6 +257,8 @@ describe "Stats", :admin do
|
||||
click_link "Polls"
|
||||
end
|
||||
|
||||
expect(page).to have_link "Go back", href: admin_stats_path
|
||||
|
||||
within("#web_participants") do
|
||||
expect(page).to have_content "3"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user