Last active
April 30, 2016 04:51
-
-
Save rx/2c1dff095caa56e816d626c659c79154 to your computer and use it in GitHub Desktop.
bad dry-validation 0.7.4 spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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