Sha256: d0f45922dfcd6a6c05550af81a85be324aaafce746992b95c8e377f3f457e862
Contents?: true
Size: 647 Bytes
Versions: 27
Compression:
Stored size: 647 Bytes
Contents
# frozen_string_literal: true # encoding: utf-8 require "spec_helper" describe ActiveModel::Validations::NumericalityValidator do describe "#validate_each" do before(:all) do class TestModel include Mongoid::Document field :amount, type: BigDecimal validates_numericality_of :amount, allow_blank: false end end after(:all) do Object.send(:remove_const, :TestModel) end context "when the value is non numeric" do let(:model) do TestModel.new(amount: "asdf") end it "returns false" do expect(model).to_not be_valid end end end end
Version data entries
27 entries across 27 versions & 2 rubygems