Fix map location update

When editing the map of a proposal or investment(the mappable) the
updated_at attribute of the mappable was not been updated and so the
map still displayed the old location after updating it
This commit is contained in:
rgarcia
2017-12-20 12:43:49 +01:00
parent 27eadfb396
commit 7889efd6ee
2 changed files with 15 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ shared_examples "map validations" do
let(:mappable) { build(model_name(described_class)) }
describe "map" do
describe "validations" do
before(:each) do
Setting["feature.map"] = true
@@ -49,5 +49,17 @@ shared_examples "map validations" do
end
end
describe "cache" do
it "should expire cache when the map is updated" do
map_location = create(:map_location)
mappable.map_location = map_location
mappable.save
expect { map_location.update(latitude: 12.34) }
.to change { mappable.reload.updated_at }
end
end
end