Merge pull request #1352 from consul/feasibility_link
Feasibility index
This commit is contained in:
11
app/views/budgets/investments/_feasibility_link.html.erb
Normal file
11
app/views/budgets/investments/_feasibility_link.html.erb
Normal 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 %>
|
||||
@@ -14,6 +14,7 @@
|
||||
<% if @budget.accepting? %>
|
||||
<%= render "shared/tag_cloud", taggable: 'budget/investment' %>
|
||||
<%= render 'categories' %>
|
||||
<%= render 'feasibility_link' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user