Allow to create an investment with a geolocation.

In the Management section when creating an investment we were not passing the
map attributes, so we were never able to associate a geolocation.
This commit is contained in:
taitus
2021-03-29 10:35:56 +02:00
parent c173568404
commit 7a34a338f4
2 changed files with 6 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
class Management::Budgets::InvestmentsController < Management::BaseController class Management::Budgets::InvestmentsController < Management::BaseController
include Translatable include Translatable
include MapLocationAttributes
include FeatureFlags include FeatureFlags
feature_flag :budgets feature_flag :budgets
@@ -57,7 +58,8 @@ class Management::Budgets::InvestmentsController < Management::BaseController
end end
def investment_params def investment_params
attributes = [:external_url, :heading_id, :tag_list, :organization_name, :location, :skip_map] attributes = [:external_url, :heading_id, :tag_list, :organization_name, :location, :skip_map,
map_location_attributes: map_location_attributes]
params.require(:budget_investment).permit(attributes, translation_params(Budget::Investment)) params.require(:budget_investment).permit(attributes, translation_params(Budget::Investment))
end end

View File

@@ -43,7 +43,9 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
find("#new_map_location").click find("#new_map_location").click
send("submit_#{mappable_factory_name}_form") send("submit_#{mappable_factory_name}_form")
expect(page).to have_css(".map_location") within ".map_location" do
expect(page).to have_css(".map-icon")
end
end end
scenario "Can not display map on #{mappable_factory_name} when not fill marker on map" do scenario "Can not display map on #{mappable_factory_name} when not fill marker on map" do