Add new setting to enable/disable map marker clustering
This commit is contained in:
committed by
Senén Rodero Rodríguez
parent
095ec8f267
commit
0643606dcd
@@ -13,15 +13,46 @@ RSpec.describe SettingsHelper do
|
||||
end
|
||||
|
||||
describe "#feature?" do
|
||||
it "returns presence of feature flag setting value" do
|
||||
it "finds settings by the given name prefixed with 'feature.' and returns its presence" do
|
||||
Setting["feature.f1"] = "active"
|
||||
Setting["feature.f2"] = ""
|
||||
Setting["feature.f3"] = nil
|
||||
Setting["feature.f2"] = true
|
||||
Setting["feature.f3"] = false
|
||||
Setting["feature.f4"] = ""
|
||||
Setting["feature.f5"] = nil
|
||||
|
||||
expect(feature?("f1")).to eq("active")
|
||||
expect(feature?("f2")).to be nil
|
||||
expect(feature?("f2")).to eq("t")
|
||||
expect(feature?("f3")).to be nil
|
||||
expect(feature?("f4")).to be nil
|
||||
expect(feature?("f5")).to be nil
|
||||
end
|
||||
|
||||
it "finds settings by the given name prefixed with 'process.' and returns its presence" do
|
||||
Setting["process.p1"] = "active"
|
||||
Setting["process.p2"] = true
|
||||
Setting["process.p3"] = false
|
||||
Setting["process.p4"] = ""
|
||||
Setting["process.p5"] = nil
|
||||
|
||||
expect(feature?("p1")).to eq("active")
|
||||
expect(feature?("p2")).to eq("t")
|
||||
expect(feature?("p3")).to be nil
|
||||
expect(feature?("p4")).to be nil
|
||||
expect(feature?("p5")).to be nil
|
||||
end
|
||||
|
||||
it "finds settings by the full key name and returns its presence" do
|
||||
Setting["map.feature.f1"] = "active"
|
||||
Setting["map.feature.f2"] = true
|
||||
Setting["map.feature.f3"] = false
|
||||
Setting["map.feature.f4"] = ""
|
||||
Setting["map.feature.f5"] = nil
|
||||
|
||||
expect(feature?("map.feature.f1")).to eq("active")
|
||||
expect(feature?("map.feature.f2")).to eq("t")
|
||||
expect(feature?("map.feature.f3")).to be nil
|
||||
expect(feature?("map.feature.f4")).to be nil
|
||||
expect(feature?("map.feature.f5")).to be nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user