Add the geozone name to the proposal partial when there are geozones defined

As we have links pointing to a search by geozone name I
think we should show somewhere the geozone where the
proposal belongs.
This commit is contained in:
Senén Rodero Rodríguez
2023-06-14 12:35:14 +02:00
parent 1bc2a68856
commit 37695cd262
3 changed files with 33 additions and 0 deletions

View File

@@ -237,6 +237,25 @@ describe "Legislation Proposals" do
expect(page).to have_link("Culture")
end
scenario "Shows geozone tag as proposals filter where there are geozones defined" do
create(:legislation_proposal, process: process)
create(:legislation_proposal, process: process, geozone: create(:geozone, name: "Zone1"))
visit legislation_process_proposals_path(process)
expect(page).to have_link("Zone1", href: legislation_process_proposals_path(process, search: "Zone1"))
link = legislation_process_proposals_path(process, search: "All city")
expect(page).to have_link("All city", href: link)
end
scenario "Does not show the geozone tag when no geozones defined" do
create(:legislation_proposal, process: process)
visit legislation_process_proposals_path(process)
expect(page).not_to have_link("All city")
end
scenario "Can filter proposals by geozone" do
geozone = create(:geozone, name: "Zone1")
proposal = create(:legislation_proposal, title: "Proposal with geozone",