Do not render the geozone link where there are no geozones defined

This commit is contained in:
Senén Rodero Rodríguez
2023-06-12 14:56:03 +02:00
parent a6b1866908
commit 9003c460d5
3 changed files with 29 additions and 0 deletions

View File

@@ -251,4 +251,21 @@ describe "Legislation Proposals" do
expect(page).to have_content("Proposal with geozone")
expect(page).not_to have_content("Proposal without geozone")
end
scenario "Show link to filter by geozone where there are geozones defined" do
create(:geozone)
create(:legislation_proposal, legislation_process_id: process.id)
visit legislation_process_proposal_path(proposal.process, proposal)
expect(page).to have_link("All city")
end
scenario "Do not show link to geozone where there are no geozones defined" do
create(:legislation_proposal, legislation_process_id: process.id)
visit legislation_process_proposal_path(proposal.process, proposal)
expect(page).not_to have_link("All city")
end
end