Merge pull request #1352 from consul/feasibility_link

Feasibility index
This commit is contained in:
Raimond Garcia
2017-01-14 12:36:26 +01:00
committed by GitHub
5 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<div class="sidebar-divider"></div>
<h2 class="sidebar-title"><%= t("budgets.investments.index.sidebar.by_feasibility") %></h2>
<br>
<% if params[:unfeasible].present? %>
<%= link_to t("budgets.investments.index.sidebar.feasible"),
budget_investments_path(@budget, heading_id: @heading, unfeasible: nil) %>
<% else %>
<%= link_to t("budgets.investments.index.sidebar.unfeasible"),
budget_investments_path(@budget, heading_id: @heading, unfeasible: 1) %>
<% end %>

View File

@@ -14,6 +14,7 @@
<% if @budget.accepting? %>
<%= render "shared/tag_cloud", taggable: 'budget/investment' %>
<%= render 'categories' %>
<%= render 'feasibility_link' %>
<% end %>

View File

@@ -64,6 +64,9 @@ en:
not_logged_in: "To create a new budget investment you must %{sign_in} or %{sign_up}."
sign_in: "sign in"
sign_up: "sign up"
by_feasibility: By feasibility
feasible: Feasible projects
unfeasible: Unfeasible projects
orders:
random: random
confidence_score: highest rated

View File

@@ -64,6 +64,9 @@ es:
not_logged_in: "Para crear una nueva propuesta de inversión debes %{sign_in} o %{sign_up}."
sign_in: "iniciar sesión"
sign_up: "registrarte"
by_feasibility: Por viabilidad
feasible: Ver los proyectos viables
unfeasible: Ver los proyectos inviables
orders:
random: Aleatorias
confidence_score: Mejor valoradas

View File

@@ -23,6 +23,21 @@ feature 'Budget Investments' do
end
end
scenario 'Feasibility links' do
visit budget_investments_path(budget, heading_id: heading.id)
expect(page).to_not have_content('Feasible projects')
within('#sidebar') do
click_link 'Unfeasible projects'
end
expect(page).to have_current_path(budget_investments_path(budget, heading_id: heading.id, unfeasible: 1))
within('#sidebar') do
click_link 'Feasible projects'
end
expect(page).to have_current_path(budget_investments_path(budget, heading_id: heading.id, unfeasible: nil))
end
context("Search") do
scenario 'Search by text' do