diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 230e25d82..99e0eb25a 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -225,7 +225,7 @@ class Budget def should_show_aside? (budget.selecting? && !unfeasible?) || (budget.balloting? && feasible?) || - (budget.valuating? && feasible?) + (budget.valuating? && !unfeasible?) end def should_show_votes? diff --git a/app/views/shared/_advanced_search.html.erb b/app/views/shared/_advanced_search.html.erb index 56157c4a7..558adc806 100644 --- a/app/views/shared/_advanced_search.html.erb +++ b/app/views/shared/_advanced_search.html.erb @@ -36,7 +36,6 @@ <%= text_field_tag 'advanced_search[date_min]', params[:advanced_search].try(:[], :date_min), - type: "date", class: 'js-calendar' %>
@@ -45,7 +44,6 @@ <%= text_field_tag 'advanced_search[date_max]', params[:advanced_search].try(:[], :date_max), - type: "date", class: 'js-calendar' %>
diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index 1d812bd7e..5446e0a0a 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -405,7 +405,7 @@ feature 'Budget Investments' do budget.update(phase: "valuating") end - scenario "Sidebar in show should display supports text and supports" do + scenario "Sidebar in show should display support text and count" do investment = create(:budget_investment, :selected, budget: budget) create(:vote, votable: investment) @@ -417,8 +417,8 @@ feature 'Budget Investments' do end end - scenario "Index should display supports" do - investment = create(:budget_investment, :selected, budget: budget, heading: heading) + scenario "Index should display support count" do + investment = create(:budget_investment, budget: budget, heading: heading) create(:vote, votable: investment) visit budget_investments_path(budget, heading_id: heading.id) @@ -428,6 +428,18 @@ feature 'Budget Investments' do end end + scenario "Show should display support text and count" do + investment = create(:budget_investment, budget: budget, heading: heading) + create(:vote, votable: investment) + + visit budget_investment_path(budget, investment) + + within("#budget_investment_#{investment.id}") do + expect(page).to have_content "Supports" + expect(page).to have_content "1 support" + end + end + end context "Balloting Phase" do