Skip to content

Commit f2e0f3e

Browse files
andreacfmDarren Chang
authored andcommitted
Addes test in failing nested given validation
1 parent b8b85af commit f2e0f3e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spec/grape/validations/params_scope_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,22 @@ def initialize(value)
479479
end.to_not raise_error
480480
end
481481

482+
it 'does not raise an error if when using nested given' do
483+
expect do
484+
subject.params do
485+
optional :a, type: Hash do
486+
requires :b
487+
end
488+
given :a do
489+
requires :c
490+
given :c do
491+
requires :d
492+
end
493+
end
494+
end
495+
end.to_not raise_error
496+
end
497+
482498
it 'allows aliasing of dependent parameters' do
483499
subject.params do
484500
optional :a

0 commit comments

Comments
 (0)