From 5b80272ae038e26556bec8050540b5ea470e2827 Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Mon, 26 Apr 2021 15:35:15 +0200 Subject: [PATCH] Test fix --- test/system/targets_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/system/targets_test.rb b/test/system/targets_test.rb index d7ce551..e39f3fe 100644 --- a/test/system/targets_test.rb +++ b/test/system/targets_test.rb @@ -272,7 +272,9 @@ class TargetsTest < BodyTrackingSystemTestCase targets.each do |target| within find('option:checked', exact_text: target.quantity.name) .ancestor('p.target') do - assert_selector 'input, select', count: 1 + 3*target.thresholds.length + field_count = 1 + 3*target.thresholds.length + field_count += (target.thresholds.last.quantity.leaf? ? 0 : 1) + assert_selector 'input, select', count: field_count target.thresholds.each do |threshold| within find('option:checked', exact_text: threshold.quantity.name)