spec/form_spec.rb in rasti-form-0.1.0 vs spec/form_spec.rb in rasti-form-1.0.0
- old
+ new
@@ -36,17 +36,12 @@
point.y.must_be_nil
point.assigned?(:x).must_equal false
point.assigned?(:y).must_equal false
end
- it 'Extra attributes' do
- point = point_class.new z: 3
- point.x.must_be_nil
- point.y.must_be_nil
- point.assigned?(:x).must_equal false
- point.assigned?(:y).must_equal false
- proc { point.z }.must_raise NoMethodError
- point.attributes.must_be_empty
+ it 'Invalid attributes' do
+ error = proc { point_class.new z: 3 }.must_raise Rasti::Form::ValidationError
+ error.message.must_equal 'Validation error: {"z":["Unexpected attribute"]}'
end
describe 'Casting' do
it 'Attribute' do
\ No newline at end of file