From 5831f190ba4b68ea4df9f8671cb38d32b13fb484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 27 Mar 2021 14:07:15 +0100 Subject: [PATCH] Fix "Go back" link in stat graphs The link appeared twice when visiting stats for a budget's supporting phase. --- app/views/admin/stats/_graph.html.erb | 2 -- app/views/admin/stats/graph.html.erb | 2 ++ spec/system/admin/stats_spec.rb | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/admin/stats/_graph.html.erb b/app/views/admin/stats/_graph.html.erb index 1a8975289..f31b0e21a 100644 --- a/app/views/admin/stats/_graph.html.erb +++ b/app/views/admin/stats/_graph.html.erb @@ -1,5 +1,3 @@ -<%= back_link_to %> -

<%= t "admin.stats.graph.#{name || event}" %> (<%= count %>)

<%= chart_tag id: name, event: event %> diff --git a/app/views/admin/stats/graph.html.erb b/app/views/admin/stats/graph.html.erb index 0a9828806..04435660c 100644 --- a/app/views/admin/stats/graph.html.erb +++ b/app/views/admin/stats/graph.html.erb @@ -2,4 +2,6 @@ <%= javascript_include_tag "stat_graphs", "data-turbolinks-track" => "reload" %> <% end %> +<%= back_link_to admin_stats_path %> + <%= render "graph", name: @name, event: @event, count: @count %> diff --git a/spec/system/admin/stats_spec.rb b/spec/system/admin/stats_spec.rb index 9e890b005..d09e27ce0 100644 --- a/spec/system/admin/stats_spec.rb +++ b/spec/system/admin/stats_spec.rb @@ -109,6 +109,7 @@ describe "Stats", :admin do end expect(page).to have_content "Votes 3" + expect(page).to have_link "Go back", count: 1 end scenario "Number of users that have supported an investment project" do