Use paths instead of URLs where possible

It simplifies the code and solves any issue we might have configuring
the host in the test environment.
This commit is contained in:
Javi Martín
2019-04-29 12:14:53 +02:00
parent db6ed4772c
commit 241ee313f1
3 changed files with 9 additions and 9 deletions

View File

@@ -98,19 +98,19 @@
<% show_links = show_links_to_budget_investments(current_budget) %> <% show_links = show_links_to_budget_investments(current_budget) %>
<% if show_links %> <% if show_links %>
<li> <li>
<%= link_to budget_url(current_budget) do %> <%= link_to budget_path(current_budget) do %>
<small><%= t("budgets.index.investment_proyects") %></small> <small><%= t("budgets.index.investment_proyects") %></small>
<% end %> <% end %>
</li> </li>
<% end %> <% end %>
<li> <li>
<%= link_to budget_url(current_budget, filter: "unfeasible") do %> <%= link_to budget_path(current_budget, filter: "unfeasible") do %>
<small><%= t("budgets.index.unfeasible_investment_proyects") %></small> <small><%= t("budgets.index.unfeasible_investment_proyects") %></small>
<% end %> <% end %>
</li> </li>
<% if show_links %> <% if show_links %>
<li> <li>
<%= link_to budget_url(current_budget, filter: "unselected") do %> <%= link_to budget_path(current_budget, filter: "unselected") do %>
<small><%= t("budgets.index.not_selected_investment_proyects") %></small> <small><%= t("budgets.index.not_selected_investment_proyects") %></small>
<% end %> <% end %>
</li> </li>

View File

@@ -76,13 +76,13 @@
<% end %> <% end %>
<p> <p>
<%= link_to budget_url(@budget) do %> <%= link_to budget_path(@budget) do %>
<small><%= t("budgets.results.investment_proyects") %></small> <small><%= t("budgets.results.investment_proyects") %></small>
<% end %><br> <% end %><br>
<%= link_to budget_url(@budget, filter: "unfeasible") do %> <%= link_to budget_path(@budget, filter: "unfeasible") do %>
<small><%= t("budgets.results.unfeasible_investment_proyects") %></small> <small><%= t("budgets.results.unfeasible_investment_proyects") %></small>
<% end %><br> <% end %><br>
<%= link_to budget_url(@budget, filter: "unselected") do %> <%= link_to budget_path(@budget, filter: "unselected") do %>
<small><%= t("budgets.results.not_selected_investment_proyects") %></small> <small><%= t("budgets.results.not_selected_investment_proyects") %></small>
<% end %> <% end %>
</p> </p>

View File

@@ -120,13 +120,13 @@ describe "Budgets" do
expect(page).to have_content "#{heading.name} €1,000,000" expect(page).to have_content "#{heading.name} €1,000,000"
expect(page).to have_link "List of all investment projects", expect(page).to have_link "List of all investment projects",
href: budget_url(budget) href: budget_path(budget)
expect(page).to have_link "List of all unfeasible investment projects", expect(page).to have_link "List of all unfeasible investment projects",
href: budget_url(budget, filter: "unfeasible") href: budget_path(budget, filter: "unfeasible")
expect(page).to have_link "List of all investment projects not selected for balloting", expect(page).to have_link "List of all investment projects not selected for balloting",
href: budget_url(budget, filter: "unselected") href: budget_path(budget, filter: "unselected")
expect(page).to have_css("div.map") expect(page).to have_css("div.map")
end end