Sha256: c5c99f557f2b4661f95f37358912d9abaabd26e1c71ff01f676883d4e6543b8c

Contents?: true

Size: 787 Bytes

Versions: 160

Compression:

Stored size: 787 Bytes

Contents

module ForestLiana
  class PieStatGetterTest < ActiveSupport::TestCase
    test 'Pie stat getter with an aggregate on a boolean field' do
      stat = PieStatGetter.new(BooleanField, {
        type: "Pie",
        collection: "boolean_field",
        timezone: "Europe/Paris",
        aggregate: "Count",
        group_by_field: "field"
      })

      stat.perform
      assert stat.record.value.count == 0
    end

    test 'Pie stat getter with an aggregate on a foreign key' do
      stat = PieStatGetter.new(BelongsToField, {
        type: "Pie",
        collection: "belongs_to_field",
        timezone: "Europe/Paris",
        aggregate: "Count",
        group_by_field: "has_one_field_id"
      })

      stat.perform
      assert stat.record.value.count == 30
    end
  end
end

Version data entries

160 entries across 160 versions & 1 rubygems

Version Path
forest_liana-6.6.3 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-7.0.0.beta.4 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-7.0.0.beta.3 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.6.2 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.6.1 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.6.0 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.5.1 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-7.0.0.beta.2 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.5.0 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.4.1 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-7.0.0.beta.1 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.4.0 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.3.8 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.3.7 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.3.6 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.3.5 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.3.4 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.3.3 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.3.2 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-6.3.1 test/services/forest_liana/pie_stat_getter_test.rb