Sha256: bf5e096c392196cd458e144739e54acfd5befca140adde06659429e926c1e23e
Contents?: true
Size: 679 Bytes
Versions: 3
Compression:
Stored size: 679 Bytes
Contents
require 'spec_helper' require 'shoulda-matchers' describe Shoulda::Matchers::ActiveModel::ValidateAsCnpjMatcher do context "on a attribute which validates cnpj" do it "should require a valid CNPJ" do @company = Company.new(:cnpj => '123456') @company.should validate_as_cnpj(:cnpj) end it "should allow a nil value" do @company = Company.new(:cnpj => nil) @company.should validate_as_cnpj(:cnpj) end end context "on a attribute which not validates cnpj" do before do @user = Admin.new(:cnpj => '123456') end it "should not require a valid CPF" do @user.should_not validate_as_cnpj(:cnpj) end end end
Version data entries
3 entries across 3 versions & 1 rubygems