Hide select text if budget finished
This commit is contained in:
@@ -47,7 +47,7 @@
|
|||||||
id: "budget_investment_visible_to_valuators" %>
|
id: "budget_investment_visible_to_valuators" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<td class="small text-center">
|
<td id="selection" class="small text-center">
|
||||||
<% if investment.selected? %>
|
<% if investment.selected? %>
|
||||||
<%= link_to_unless investment.budget.finished?,
|
<%= link_to_unless investment.budget.finished?,
|
||||||
t("admin.budget_investments.index.selected"),
|
t("admin.budget_investments.index.selected"),
|
||||||
@@ -63,19 +63,20 @@
|
|||||||
remote: true,
|
remote: true,
|
||||||
class: "button small expanded" %>
|
class: "button small expanded" %>
|
||||||
<% elsif investment.feasible? && investment.valuation_finished? %>
|
<% elsif investment.feasible? && investment.valuation_finished? %>
|
||||||
<%= link_to_unless investment.budget.finished?,
|
<% unless investment.budget.finished? %>
|
||||||
t("admin.budget_investments.index.select"),
|
<%= link_to t("admin.budget_investments.index.select"),
|
||||||
toggle_selection_admin_budget_budget_investment_path(@budget,
|
toggle_selection_admin_budget_budget_investment_path(@budget,
|
||||||
investment,
|
investment,
|
||||||
filter: params[:filter],
|
filter: params[:filter],
|
||||||
sort_by: params[:sort_by],
|
sort_by: params[:sort_by],
|
||||||
min_total_supports: params[:min_total_supports],
|
min_total_supports: params[:min_total_supports],
|
||||||
max_total_supports: params[:max_total_supports],
|
max_total_supports: params[:max_total_supports],
|
||||||
advanced_filters: params[:advanced_filters],
|
advanced_filters: params[:advanced_filters],
|
||||||
page: params[:page]),
|
page: params[:page]),
|
||||||
method: :patch,
|
method: :patch,
|
||||||
remote: true,
|
remote: true,
|
||||||
class: "button small hollow expanded" %>
|
class: "button small hollow expanded" %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
<% if params[:filter] == "selected" %>
|
<% if params[:filter] == "selected" %>
|
||||||
|
|||||||
@@ -1407,6 +1407,32 @@ feature "Admin budget investments" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Show only selected text when budget is finished" do
|
||||||
|
budget.update(phase: "finished")
|
||||||
|
|
||||||
|
visit admin_budget_budget_investments_path(budget)
|
||||||
|
|
||||||
|
within("#budget_investment_#{unfeasible_bi.id} #selection") do
|
||||||
|
expect(page).not_to have_content("Select")
|
||||||
|
expect(page).not_to have_content("Selected")
|
||||||
|
end
|
||||||
|
|
||||||
|
within("#budget_investment_#{feasible_bi.id} #selection") do
|
||||||
|
expect(page).not_to have_content("Select")
|
||||||
|
expect(page).not_to have_content("Selected")
|
||||||
|
end
|
||||||
|
|
||||||
|
within("#budget_investment_#{feasible_vf_bi.id} #selection") do
|
||||||
|
expect(page).not_to have_content("Select")
|
||||||
|
expect(page).not_to have_content("Selected")
|
||||||
|
end
|
||||||
|
|
||||||
|
within("#budget_investment_#{selected_bi.id} #selection") do
|
||||||
|
expect(page).not_to contain_exactly("Select")
|
||||||
|
expect(page).to have_content("Selected")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Selecting an investment", :js do
|
scenario "Selecting an investment", :js do
|
||||||
visit admin_budget_budget_investments_path(budget)
|
visit admin_budget_budget_investments_path(budget)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user