Skip to content

Instantly share code, notes, and snippets.

@rx
Last active April 30, 2016 04:51
Show Gist options
  • Save rx/2c1dff095caa56e816d626c659c79154 to your computer and use it in GitHub Desktop.
Save rx/2c1dff095caa56e816d626c659c79154 to your computer and use it in GitHub Desktop.
bad dry-validation 0.7.4 spec
describe "Bad Validation Spec" do
subject {
Dry::Validation.Form do
key(:id).required
key(:foo).schema do
optional(:bar).maybe
optional(:goo).maybe
optional(:zurb).maybe # comment this line out and it works
end
end
}
let(:params) {
{id: 92,
foo: {
'id' => nil,
'bar' => 'new name',
'goo' => 'skuU',
'zurb' => 3,
}
}
}
it {
expect(subject.call(params)[:foo].key?('id')).to eq(false)
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment