Sha256: d4901c9197ef72ac4d96ecccb34331a2dbebde62ea79e4c0dcbfaad5bf3695ab

Contents?: true

Size: 453 Bytes

Versions: 7

Compression:

Stored size: 453 Bytes

Contents

require 'spec_helper'
require 'shoulda-matchers'

describe Shoulda::Matchers::ActiveModel::RequireAValidCnpjMatcher do
  before :each do
    @company = Company.new
  end

  it "should accept on cnpj" do
    @company.should require_a_valid_cnpj(:cnpj)
  end

  it "should accept without a specified attribute" do
    @company.should require_a_valid_cnpj
  end

  it "should reject on name" do
    @company.should_not require_a_valid_cnpj(:name)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
validates_cnpj-2.0.1 spec/validates_cnpj/validate_as_cnpj_matcher_spec.rb
validates_cnpj-2.0.0 spec/validate_as_cnpj_matcher_spec.rb
validates_cnpj-1.1.3 spec/validates_cnpj/shoulda-matchers/validate_as_cnpj_matcher_spec.rb
validates_cnpj-1.1.2 spec/validates_cnpj/shoulda-matchers/validate_as_cnpj_matcher_spec.rb
validates_cnpj-1.1.1 spec/validates_cnpj/shoulda-matchers/validate_as_cnpj_matcher_spec.rb
validates_cnpj-1.1.0 spec/validates_cnpj/shoulda-matchers/validate_as_cnpj_matcher_spec.rb
validates_cnpj-1.0.0 spec/validates_cnpj/shoulda-matchers/validate_as_cnpj_matcher_spec.rb