forest_liana 1.6.15 → 1.6.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
1
+ module ForestLiana
2
+ class PieStatGetterTest < ActiveSupport::TestCase
3
+ test 'Pie stat getter with an aggregate on a boolean field' do
4
+ stat = PieStatGetter.new(BooleanField, {
5
+ type: "Pie",
6
+ collection: "boolean_field",
7
+ timezone: "+02:00",
8
+ aggregate: "Count",
9
+ group_by_field: "field"
10
+ })
11
+
12
+ stat.perform
13
+ assert stat.record.value.count == 0
14
+ end
15
+
16
+ test 'Pie stat getter with an aggregate on a foreign key' do
17
+ stat = PieStatGetter.new(BelongsToField, {
18
+ type: "Pie",
19
+ collection: "belongs_to_field",
20
+ timezone: "+02:00",
21
+ aggregate: "Count",
22
+ group_by_field: "has_one_field_id"
23
+ })
24
+
25
+ stat.perform
26
+ assert stat.record.value.count == 30
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.15
4
+ version: 1.6.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-11 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -289,6 +289,7 @@ files:
289
289
  - test/forest_liana_test.rb
290
290
  - test/integration/navigation_test.rb
291
291
  - test/services/forest_liana/has_many_getter_test.rb
292
+ - test/services/forest_liana/pie_stat_getter_test.rb
292
293
  - test/services/forest_liana/resource_updater_test.rb
293
294
  - test/services/forest_liana/resources_getter_test.rb
294
295
  - test/services/forest_liana/schema_adapter_test.rb
@@ -402,6 +403,7 @@ test_files:
402
403
  - test/forest_liana_test.rb
403
404
  - test/integration/navigation_test.rb
404
405
  - test/services/forest_liana/has_many_getter_test.rb
406
+ - test/services/forest_liana/pie_stat_getter_test.rb
405
407
  - test/services/forest_liana/resource_updater_test.rb
406
408
  - test/services/forest_liana/resources_getter_test.rb
407
409
  - test/services/forest_liana/schema_adapter_test.rb