1
0

Test pass: test_update_swap_targets

New fixtures + test fixes
This commit is contained in:
cryptogopher
2021-04-26 00:16:10 +02:00
parent bbc1467965
commit ab40c3bb0b
4 changed files with 99 additions and 23 deletions

View File

@@ -20,11 +20,20 @@ quantities_proteins:
name: Proteins
description: Total amount of proteins
quantities_fats:
<<: *DEFAULTS
domain: diet
lft: 5
rgt: 6
depth: 0
name: Fats
description: Total amount of fats
quantities_target_above:
<<: *DEFAULTS
domain: target
lft: 5
rgt: 8
lft: 7
rgt: 10
depth: 0
name: above
description: Lower bound
@@ -33,8 +42,8 @@ quantities_target_range:
<<: *DEFAULTS
parent: quantities_target_above
domain: target
lft: 6
rgt: 7
lft: 8
rgt: 9
depth: 1
name: and below
description: Range
@@ -42,8 +51,8 @@ quantities_target_range:
quantities_target_equal:
<<: *DEFAULTS
domain: target
lft: 9
rgt: 10
lft: 11
rgt: 12
depth: 0
name: equal
description: Exact value

View File

@@ -5,3 +5,27 @@ quantity_values_001:
quantity: quantities_target_equal
value: 2500
unit: units_kcal
quantity_values_002:
type: Threshold
registry_type: Target
registry: targets_02
quantity: quantities_target_above
value: 20
unit: units_gram
quantity_values_003:
type: Threshold
registry_type: Target
registry: targets_02
quantity: quantities_target_range
value: 30
unit: units_gram
quantity_values_004:
type: Threshold
registry_type: Target
registry: targets_03
quantity: quantities_target_above
value: 1900
unit: units_kcal

View File

@@ -2,3 +2,13 @@ targets_01:
goal: goals_binding
quantity: quantities_energy
effective_from: <%= 1.week.ago.to_s(:db) %>
targets_02:
goal: goals_binding
quantity: quantities_proteins
effective_from: <%= 1.week.ago.to_s(:db) %>
targets_03:
goal: goals_binding
quantity: quantities_energy
effective_from: <%= 2.days.ago.to_s(:db) %>