Merge pull request #3106 from consul/2918-crud_budget_groups_headings
Change CRUD for budget groups and headings
This commit is contained in:
@@ -161,6 +161,34 @@ feature 'Ballots' do
|
||||
end
|
||||
end
|
||||
|
||||
scenario "the Map shoud be visible before and after", :js do
|
||||
investment = create(:budget_investment, :selected, heading: new_york, price: 10000)
|
||||
|
||||
visit budget_path(budget)
|
||||
click_link "States"
|
||||
click_link "New York"
|
||||
|
||||
within("#sidebar") do
|
||||
expect(page).to have_content "OpenStreetMap"
|
||||
end
|
||||
|
||||
add_to_ballot(investment)
|
||||
|
||||
within("#sidebar") do
|
||||
expect(page).to have_content investment.title
|
||||
expect(page).to have_content "OpenStreetMap"
|
||||
end
|
||||
|
||||
within("#budget_investment_#{investment.id}") do
|
||||
click_link "Remove vote"
|
||||
end
|
||||
|
||||
within("#sidebar") do
|
||||
expect(page).not_to have_content investment.title
|
||||
expect(page).to have_content "OpenStreetMap"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
#Break up or simplify with helpers
|
||||
|
||||
@@ -93,6 +93,22 @@ feature 'Budget Investments' do
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Index should show a map if heading has coordinates defined', :js do
|
||||
create(:budget_investment, heading: heading)
|
||||
visit budget_investments_path(budget, heading_id: heading.id)
|
||||
within("#sidebar") do
|
||||
expect(page).to have_css(".map_location")
|
||||
end
|
||||
|
||||
unlocated_heading = create(:budget_heading, name: "No Map", price: 500, group: group,
|
||||
longitude: nil, latitude: nil)
|
||||
create(:budget_investment, heading: unlocated_heading)
|
||||
visit budget_investments_path(budget, heading_id: unlocated_heading.id)
|
||||
within("#sidebar") do
|
||||
expect(page).not_to have_css(".map_location")
|
||||
end
|
||||
end
|
||||
|
||||
context("Search") do
|
||||
|
||||
scenario 'Search by text' do
|
||||
|
||||
Reference in New Issue
Block a user