cartodb-4.42/spec/factories/widgets.rb

41 lines
782 B
Ruby
Raw Permalink Normal View History

2024-04-06 13:25:13 +08:00
require_relative '../../app/models/carto/widget'
FactoryGirl.define do
factory :widget, class: Carto::Widget do
ignore do
column_name 'pop_max'
end
order 1
type 'formula'
title 'The Title'
source_id 'a0'
options do
{
type: "formula",
column: column_name,
operation: "min"
}
end
style do
{
widget_style: {
definition: {
fill: { color: { fixed: '#FFF' } }
}
},
auto_style: {
definition: {
fill: { color: { fixed: '#FFF' } }
}
}
}
end
created_at { Time.now }
updated_at { Time.now }
factory :widget_with_layer do
association :layer, factory: :carto_layer
end
end
end