spec/acfs/model/attributes_spec.rb in acfs-0.24.0.1.b214 vs spec/acfs/model/attributes_spec.rb in acfs-0.24.0.1.b216
- old
+ new
@@ -149,8 +149,19 @@
resource.updated_at = ''
expect(resource.updated_at).to eq nil
end
end
+
+ context 'allow blank option' do
+ it 'should allow blank as value' do
+ model.send :attribute, :updated_at, Acfs::Model::Attributes::DateTime, default: DateTime.new, allow_blank: true
+ resource = model.new
+ expect(resource.updated_at).to eq DateTime.new
+
+ resource.updated_at = ''
+ expect(resource.updated_at).to eq nil
+ end
+ end
end
end
end