Do not show the geozone selector where there are no geozones defined
This commit is contained in:
@@ -49,10 +49,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% if Geozone.any? %>
|
||||||
<div>
|
<div>
|
||||||
<%= f.select :geozone_id, geozone_select_options,
|
<%= f.select :geozone_id, geozone_select_options,
|
||||||
include_blank: t("geozones.none") %>
|
include_blank: t("geozones.none") %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if feature?(:map) %>
|
<% if feature?(:map) %>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -36,9 +36,11 @@
|
|||||||
<%= render "documents/nested_documents", f: f %>
|
<%= render "documents/nested_documents", f: f %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<% if Geozone.any? %>
|
||||||
<div class="small-12 medium-6 column">
|
<div class="small-12 medium-6 column">
|
||||||
<%= f.select :geozone_id, geozone_select_options, include_blank: t("geozones.none") %>
|
<%= f.select :geozone_id, geozone_select_options, include_blank: t("geozones.none") %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="small-12 column">
|
<div class="small-12 column">
|
||||||
<%= f.label :tag_list, t("legislation.proposals.form.tags_label") %>
|
<%= f.label :tag_list, t("legislation.proposals.form.tags_label") %>
|
||||||
|
|||||||
@@ -268,4 +268,21 @@ describe "Legislation Proposals" do
|
|||||||
|
|
||||||
expect(page).not_to have_link("All city")
|
expect(page).not_to have_link("All city")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "form shows the geozone selector when there are geozones defined" do
|
||||||
|
create(:geozone)
|
||||||
|
login_as user
|
||||||
|
|
||||||
|
visit new_legislation_process_proposal_path(process)
|
||||||
|
|
||||||
|
expect(page).to have_field("Scope of operation")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario "form do not show geozone selector when there are no geozones defined" do
|
||||||
|
login_as user
|
||||||
|
|
||||||
|
visit new_legislation_process_proposal_path(process)
|
||||||
|
|
||||||
|
expect(page).not_to have_field("Scope of operation")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -566,6 +566,25 @@ describe "Proposals" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "form shows the geozone selector when there are geozones defined" do
|
||||||
|
create(:geozone)
|
||||||
|
author = create(:user)
|
||||||
|
login_as(author)
|
||||||
|
|
||||||
|
visit new_proposal_path
|
||||||
|
|
||||||
|
expect(page).to have_field("Scope of operation")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario "form do not show geozone selector when there are no geozones defined" do
|
||||||
|
author = create(:user)
|
||||||
|
login_as(author)
|
||||||
|
|
||||||
|
visit new_proposal_path
|
||||||
|
|
||||||
|
expect(page).not_to have_field("Scope of operation")
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Specific geozone" do
|
scenario "Specific geozone" do
|
||||||
create(:geozone, name: "California")
|
create(:geozone, name: "California")
|
||||||
create(:geozone, name: "New York")
|
create(:geozone, name: "New York")
|
||||||
|
|||||||
Reference in New Issue
Block a user