add test for forms definition changes

pull/9729/head
Guido Fioravantti 8 years ago
parent 262d847b05
commit 7ad6cbffeb

@ -282,6 +282,7 @@ SPEC_HELPER_MIN_SPECS = \
spec/lib/carto/styles/polygon_spec.rb \
spec/lib/carto/styles/line_spec.rb \
spec/lib/carto/styles/presenters/cartocss_spec.rb \
spec/lib/carto/forms_definition_spec.rb \
spec/lib/carto/form_spec.rb \
$(NULL)

@ -0,0 +1,64 @@
# encoding utf-8
require 'spec_helper_min'
module Carto
describe 'Forms definition' do
let(:production_forms_definition) do
{
"fill" => {
"size" => {
"fixed" => 7
},
"color" => {
"fixed" => "#FFB927",
"opacity" => 0.9
}
},
"stroke" => {
"size" => {
"fixed" => 1
},
"color" => {
"fixed" => "#FFF",
"opacity" => 1
}
},
"blending" => "none",
"aggregation" => {},
"labels" => {
"enabled" => false,
"attribute" => nil,
"font" => "DejaVu Sans Book",
"fill" => {
"size" => {
"fixed" => 10
},
"color" => {
"fixed" => "#FFFFFF",
"opacity" => 1
}
},
"halo" => {
"size" => {
"fixed" => 1
},
"color" => {
"fixed" => "#6F808D",
"opacity" => 1
}
},
"offset" => -10,
"overlap" => true,
"placement" => "point"
}
}
end
it 'default has stayed the same' do
file_path = Carto::Form::DEFAULT_FORMS_DEFINITION_LOCATION
Carto::Definition.instance.load_from_file(file_path).should eq production_forms_definition
end
end
end
Loading…
Cancel
Save