cartodb/spec/factories/widgets.rb

41 lines
782 B
Ruby
Raw Normal View History

2020-06-15 10:58:47 +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