Added investment's user generated tags to admin interface form

This commit is contained in:
Manuel Ortega
2017-10-17 18:11:29 +02:00
parent 10d7a1d89b
commit 12ac758e8e
5 changed files with 33 additions and 7 deletions

View File

@@ -421,20 +421,37 @@ feature 'Admin budget investments' do
end
end
scenario "Only displays valuation tags" do
scenario "Changes valuation and user generated tags" do
budget_investment = create(:budget_investment, tag_list: 'Park')
budget_investment.set_tag_list_on(:valuation, 'Education')
budget_investment.save
visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment)
expect(page).to have_content "Education"
expect(page).to_not have_content "Park"
within("#user-tags") do
expect(page).to_not have_content "Education"
expect(page).to have_content "Park"
end
click_link 'Edit classification'
expect(page).to have_content "Education"
expect(page).to_not have_content "Park"
fill_in 'budget_investment_tag_list', with: 'Park, Trees'
fill_in 'budget_investment_valuation_tag_list', with: 'Education, Environment'
click_button 'Update'
visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment)
within("#user-tags") do
expect(page).to_not have_content "Education"
expect(page).to_not have_content "Environment"
expect(page).to have_content "Park, Trees"
end
within("#tags") do
expect(page).to have_content "Education, Environment"
expect(page).to_not have_content "Park"
expect(page).to_not have_content "Trees"
end
end
scenario "Maintains user tags" do