Manage the render of the price field on admin investments section
This commit is contained in:
@@ -30,7 +30,9 @@
|
||||
</th>
|
||||
<th data-field="geozone"><%= t("admin.budget_investments.index.list.geozone") %></th>
|
||||
<th data-field="feasibility"><%= t("admin.budget_investments.index.list.feasibility") %></th>
|
||||
<% if @budget.show_money? %>
|
||||
<th data-field="price"><%= t("admin.budget_investments.index.list.price") %></th>
|
||||
<% end %>
|
||||
<th data-field="valuation_finished">
|
||||
<%= t("admin.budget_investments.index.list.valuation_finished") %>
|
||||
</th>
|
||||
|
||||
@@ -42,9 +42,11 @@
|
||||
<%= t("admin.budget_investments.index.feasibility.#{investment.feasibility}") %>
|
||||
</td>
|
||||
|
||||
<% if @budget.show_money? %>
|
||||
<td class="small" data-field="price">
|
||||
<%= investment.formatted_price %>
|
||||
</td>
|
||||
<% end %>
|
||||
|
||||
<td class="small text-center" data-field="valuation_finished">
|
||||
<%= investment.valuation_finished? ? t("shared.yes") : t("shared.no") %>
|
||||
|
||||
@@ -30,6 +30,19 @@ describe "Admin budget investments", :admin do
|
||||
expect(page).to have_content(budget_investment.total_votes)
|
||||
end
|
||||
|
||||
scenario "Do not show price column on budgets with hide money" do
|
||||
budget_hide_money = create(:budget, :hide_money)
|
||||
budget_investment = create(:budget_investment, budget: budget_hide_money)
|
||||
|
||||
visit admin_budget_budget_investments_path(budget_hide_money)
|
||||
|
||||
expect(page).to have_content(budget_investment.title)
|
||||
expect(page).to have_content(budget_investment.heading.name)
|
||||
expect(page).to have_content(budget_investment.id)
|
||||
expect(page).not_to have_content("Price")
|
||||
expect(page).not_to have_content("€")
|
||||
end
|
||||
|
||||
scenario "If budget is finished do not show 'Selected' button" do
|
||||
finished_budget = create(:budget, :finished)
|
||||
budget_investment = create(:budget_investment, budget: finished_budget, cached_votes_up: 77)
|
||||
|
||||
Reference in New Issue
Block a user