From 50ef23205f63241129ba72d2aadbab0514e4099d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Thu, 8 Sep 2016 12:42:28 +0200 Subject: [PATCH 1/4] avoids loading featured proposals if voting notice --- app/controllers/proposals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index 898ad9949..ee241c49b 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -27,8 +27,8 @@ class ProposalsController < ApplicationController def index_customization load_retired - load_featured load_proposal_ballots + load_featured if @proposal_ballots.blank? end def vote From 974c4d6d705de1e0921dc745cacc5468ea6c026f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Thu, 8 Sep 2016 12:43:06 +0200 Subject: [PATCH 2/4] adds specs for proposal ballots --- .../_featured_successfull_proposal.html.erb | 2 +- app/views/proposals/index.html.erb | 2 +- app/views/proposals/show.html.erb | 20 +++---- spec/features/proposal_ballots_spec.rb | 58 +++++++++++++++++++ spec/support/common_actions.rb | 5 ++ 5 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 spec/features/proposal_ballots_spec.rb diff --git a/app/views/proposal_ballots/_featured_successfull_proposal.html.erb b/app/views/proposal_ballots/_featured_successfull_proposal.html.erb index 97754ce9c..3cc18a992 100644 --- a/app/views/proposal_ballots/_featured_successfull_proposal.html.erb +++ b/app/views/proposal_ballots/_featured_successfull_proposal.html.erb @@ -1,3 +1,3 @@ -
+

<%= link_to proposal.title, proposal_ballots_path %>

diff --git a/app/views/proposals/index.html.erb b/app/views/proposals/index.html.erb index 93574c1ad..5dee606d0 100644 --- a/app/views/proposals/index.html.erb +++ b/app/views/proposals/index.html.erb @@ -32,7 +32,7 @@ <% end %> <% if @proposal_ballots.present? %> -