Sha256: 13e7a9fe52858e001b7a1ba7c1c3d9e63dc378740ba6d556a9138ebb9fbc72aa

Contents?: true

Size: 775 Bytes

Versions: 51

Compression:

Stored size: 775 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: "+02:00",
        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: "+02:00",
        aggregate: "Count",
        group_by_field: "has_one_field_id"
      })

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

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
forest_liana-2.5.0 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.9 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.8 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.7 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.6 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.5 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.4 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.3 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.2 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.1 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.4.0 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.3.5 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.3.4 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.3.3 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.3.2 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.3.1 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.3.0 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.2.2 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.2.1 test/services/forest_liana/pie_stat_getter_test.rb
forest_liana-2.2.0 test/services/forest_liana/pie_stat_getter_test.rb