forest_liana 1.6.10 → 1.6.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,37 @@
1
+ module ForestLiana
2
+ class ValueStatGetterTest < ActiveSupport::TestCase
3
+ test 'Value stat getter with a simple filter' do
4
+ stat = ValueStatGetter.new(BooleanField, {
5
+ type: "Value",
6
+ collection: "boolean_field",
7
+ timezone: "+02:00",
8
+ aggregate: "Count",
9
+ filterType: "and",
10
+ filters: [{
11
+ field: "field",
12
+ value: "true"
13
+ }]
14
+ })
15
+
16
+ stat.perform
17
+ assert stat.record.value[:countCurrent] == 0
18
+ end
19
+
20
+ test 'Value stat getter with a filter on a belongs_to field' do
21
+ stat = ValueStatGetter.new(BelongsToField, {
22
+ type: "Value",
23
+ collection: "belongs_to_field",
24
+ timezone: "+02:00",
25
+ aggregate: "Count",
26
+ filterType: "and",
27
+ filters: [{
28
+ field: "has_one_field:id",
29
+ value: "3"
30
+ }]
31
+ })
32
+
33
+ stat.perform
34
+ assert stat.record.value[:countCurrent] == 1
35
+ end
36
+ end
37
+ 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.10
4
+ version: 1.6.11
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-05-30 00:00:00.000000000 Z
11
+ date: 2017-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -269,6 +269,8 @@ files:
269
269
  - test/dummy/db/migrate/20160627172951_create_tree.rb
270
270
  - test/dummy/db/migrate/20160628173505_add_timestamps.rb
271
271
  - test/dummy/db/schema.rb
272
+ - test/dummy/db/test.sqlite3
273
+ - test/dummy/log/test.log
272
274
  - test/dummy/public/404.html
273
275
  - test/dummy/public/422.html
274
276
  - test/dummy/public/500.html
@@ -284,6 +286,7 @@ files:
284
286
  - test/integration/navigation_test.rb
285
287
  - test/services/forest_liana/resources_getter_test.rb
286
288
  - test/services/forest_liana/schema_adapter_test.rb
289
+ - test/services/forest_liana/value_stat_getter_test.rb
287
290
  - test/test_helper.rb
288
291
  homepage:
289
292
  licenses:
@@ -305,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
308
  version: '0'
306
309
  requirements: []
307
310
  rubyforge_project:
308
- rubygems_version: 2.6.12
311
+ rubygems_version: 2.5.1
309
312
  signing_key:
310
313
  specification_version: 4
311
314
  summary: Instant and Customizable Admin Interface.
@@ -372,6 +375,8 @@ test_files:
372
375
  - test/dummy/db/migrate/20160627172951_create_tree.rb
373
376
  - test/dummy/db/migrate/20160628173505_add_timestamps.rb
374
377
  - test/dummy/db/schema.rb
378
+ - test/dummy/db/test.sqlite3
379
+ - test/dummy/log/test.log
375
380
  - test/dummy/public/404.html
376
381
  - test/dummy/public/422.html
377
382
  - test/dummy/public/500.html
@@ -389,4 +394,5 @@ test_files:
389
394
  - test/integration/navigation_test.rb
390
395
  - test/services/forest_liana/resources_getter_test.rb
391
396
  - test/services/forest_liana/schema_adapter_test.rb
397
+ - test/services/forest_liana/value_stat_getter_test.rb
392
398
  - test/test_helper.rb