Modified the investments partial to fit the new budget_investments UI: valuating filter name has changed to under_valuation.

Modified the specs to fit the new UI for budget_investments
This commit is contained in:
iagirre
2018-01-24 14:40:42 +01:00
parent b8cc10d218
commit e2a91c6cc8
2 changed files with 15 additions and 11 deletions

View File

@@ -28,12 +28,13 @@
<th><%= t("admin.budget_investments.index.table_feasibility") %></th>
<th class="text-center"><%= t("admin.budget_investments.index.table_valuation_finished") %></th>
<th class="text-center">
<% if params[:filter] == "valuating" %>
<% if params[:filter] == "under_valuation" %>
<%= t("admin.budget_investments.index.table_evaluation") %>
<% else %>
<%= t("admin.budget_investments.index.table_selection") %>
<% end %>
</th>
<% if params[:filter] == "selected" %>
<th class="text-center"><%= t("admin.budget_investments.index.table_incompatible") %></th>
<% end %>
</tr>
@@ -82,7 +83,7 @@
<%= investment.valuation_finished? ? t("shared.yes"): t("shared.no") %>
</td>
<td class="small text-center">
<% if params[:filter] == "valuating" %>
<% if params[:filter] == "under_valuation" %>
<%= form_for [:admin, investment.budget, investment], remote: true do |f| %>
<%= f.check_box :visible_to_valuators,
label: false,

View File

@@ -8,8 +8,8 @@ feature 'Admin budget investments' do
end
background do
admin = create(:administrator)
login_as(admin.user)
@admin = create(:administrator)
login_as(@admin.user)
end
context "Feature flag" do
@@ -953,8 +953,8 @@ feature 'Admin budget investments' do
scenario "Mark as visible to valuator", :js do
valuator = create(:valuator)
investment1 = create(:budget_investment, heading: heading)
investment2 = create(:budget_investment, heading: heading)
investment1 = create(:budget_investment, heading: heading, administrator_id: @admin.id)
investment2 = create(:budget_investment, heading: heading, administrator_id: @admin.id)
investment1.valuators << valuator
investment2.valuators << valuator
@@ -981,8 +981,8 @@ feature 'Admin budget investments' do
scenario "Unmark as visible to valuator", :js do
valuator = create(:valuator)
investment1 = create(:budget_investment, heading: heading, visible_to_valuators: true)
investment2 = create(:budget_investment, heading: heading, visible_to_valuators: true)
investment1 = create(:budget_investment, heading: heading, visible_to_valuators: true, administrator_id: @admin.id)
investment2 = create(:budget_investment, heading: heading, visible_to_valuators: true, administrator_id: @admin.id)
investment1.valuators << valuator
investment2.valuators << valuator
@@ -1008,14 +1008,17 @@ feature 'Admin budget investments' do
end
scenario "Showing the valuating checkbox" do
investment1 = create(:budget_investment, heading: heading, visible_to_valuators: true)
investment2 = create(:budget_investment, heading: heading, visible_to_valuators: false)
investment1 = create(:budget_investment, heading: heading, visible_to_valuators: true, administrator_id: @admin.id)
investment2 = create(:budget_investment, heading: heading, visible_to_valuators: false, administrator_id: @admin.id)
investment1.valuators << create(:valuator)
investment2.valuators << create(:valuator)
visit admin_budget_budget_investments_path(@budget)
within('#filter-subnav') { click_link 'All' }
within('#filter-subnav') do
expect(page).not_to have_link "All"
expect(page).to have_content "All"
end
expect(page).not_to have_css("#budget_investment_visible_to_valuators")
expect(page).not_to have_css("#budget_investment_visible_to_valuators")