Manage the render of the price field on admin budget headings
Avoid displaying the price in admin budget headings section and avoid fill the field 'price' in admin budget headings form when the budget has been checked with hide_money field.
This commit is contained in:
@@ -123,6 +123,19 @@ describe "Admin budget headings", :admin do
|
||||
expect(page).to have_content "can't be blank"
|
||||
end
|
||||
|
||||
scenario "Heading money field is hidden if hide money is true" do
|
||||
budget_hide_money = create(:budget, :hide_money)
|
||||
group = create(:budget_group, budget: budget_hide_money)
|
||||
|
||||
visit new_admin_budget_group_heading_path(budget_hide_money, group)
|
||||
|
||||
fill_in "Heading name", with: "Heading without money"
|
||||
click_button "Create new heading"
|
||||
|
||||
expect(page).to have_content "Heading created successfully!"
|
||||
expect(page).not_to have_content "Money amount"
|
||||
end
|
||||
|
||||
describe "Max votes is optional" do
|
||||
scenario "do no show max_ballot_lines field for knapsack budgets" do
|
||||
visit new_admin_budget_group_heading_path(budget, group)
|
||||
|
||||
@@ -161,6 +161,8 @@ describe "Admin budgets", :admin do
|
||||
expect(page).to have_content "All city"
|
||||
expect(page).to have_link "Continue to phases"
|
||||
expect(page).not_to have_content "There are no headings."
|
||||
expect(page).not_to have_content "Money amount"
|
||||
expect(page).not_to have_content "€"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -341,6 +343,8 @@ describe "Admin budgets", :admin do
|
||||
|
||||
expect(page).to have_content heading.name
|
||||
expect(page).to have_content heading_2.name
|
||||
expect(page).not_to have_content "Money amount"
|
||||
expect(page).not_to have_content "€"
|
||||
|
||||
visit edit_admin_budget_path(budget_hide_money)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user