forked from consuldemocracy/consuldemocracy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from rockandror/ciudades-abiertas/map-configur…
…ation-section Ciudades abiertas/map configuration section
- Loading branch information
Showing
8 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "rails_helper" | ||
|
||
describe MapLocationsHelper do | ||
|
||
describe "#prepare_map_settings" do | ||
|
||
it "returns tiles provider values from Secrets when related settings do not exists" do | ||
options = prepare_map_settings(MapLocation.new, false, "budgets", nil) | ||
|
||
expect(options[:map_tiles_provider]).to eq "//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" | ||
expect(options[:map_tiles_provider_attribution]).to eq "© <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors" | ||
end | ||
|
||
it "returns tiles provider values from Settings when related settings are definded" do | ||
Setting["map.tiles_provider"] = "example_map_tiles_provider" | ||
Setting["map.tiles_provider_attribution"] = "example_map_tiles_provider_attribution" | ||
options = prepare_map_settings(MapLocation.new, false, "budgets", nil) | ||
|
||
expect(options[:map_tiles_provider]).to eq "example_map_tiles_provider" | ||
expect(options[:map_tiles_provider_attribution]).to eq "example_map_tiles_provider_attribution" | ||
end | ||
|
||
end | ||
|
||
end |