Add feature specs to check that edit links and "Selected" buttons are not displayed/enabled.

"Selected" button appears as text instead of dissapearing completely.
This commit is contained in:
iagirre
2017-12-27 16:23:21 +01:00
parent ec8715efd3
commit 64aaa97d86
2 changed files with 78 additions and 45 deletions

View File

@@ -55,28 +55,24 @@
<%= investment.valuation_finished? ? t('shared.yes'): t('shared.no') %>
</td>
<td class="small">
<% unless investment.budget.finished? %>
<% if investment.selected? %>
<%= link_to toggle_selection_admin_budget_budget_investment_path(@budget,
investment,
filter: params[:filter],
page: params[:page]),
method: :patch,
remote: true,
class: "button small expanded" do %>
<%= t("admin.budget_investments.index.selected") %>
<% end %>
<% elsif investment.feasible? && investment.valuation_finished? %>
<%= link_to toggle_selection_admin_budget_budget_investment_path(@budget,
investment,
filter: params[:filter],
page: params[:page]),
method: :patch,
remote: true,
class: "button small hollow expanded" do %>
<%= t("admin.budget_investments.index.select") %>
<% end %>
<% end %>
<% if investment.selected? %>
<%= link_to_unless investment.budget.finished?, t("admin.budget_investments.index.selected"),
toggle_selection_admin_budget_budget_investment_path(@budget,
investment,
filter: params[:filter],
page: params[:page]),
method: :patch,
remote: true,
class: "button small expanded" %>
<% elsif investment.feasible? && investment.valuation_finished? %>
<%= link_to_unless investment.budget.finished?, t("admin.budget_investments.index.select"),
toggle_selection_admin_budget_budget_investment_path(@budget,
investment,
filter: params[:filter],
page: params[:page]),
method: :patch,
remote: true,
class: "button small hollow expanded" %>
<% end %>
</td>
<% if params[:filter] == 'selected' %>