Skip to content

Added test for failing nested given validation #1804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions spec/grape/validations/params_scope_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,22 @@ def initialize(value)
end.to_not raise_error
end

it 'does not raise an error if when using nested given' do
expect do
subject.params do
optional :a, type: Hash do
requires :b
end
given :a do
requires :c
given :c do
requires :d
end
end
end
end.to_not raise_error
end

it 'allows aliasing of dependent parameters' do
subject.params do
optional :a
Expand Down