Sha256: e99ea5fd7d028350a60b94914eacefe1c594ccc4215d3d299e0ce28dd4ca9653

Contents?: true

Size: 550 Bytes

Versions: 3

Compression:

Stored size: 550 Bytes

Contents

require 'spec_helper'
require 'rspec'
require 'active_model'

class BasicPeselModel
  include ActiveModel::Validations

  attr_accessor :pesel

  validates :pesel, :presence => true, :pesel => true
end

  
  describe "PeselValidator" do
    before(:each) do
      @model = BasicPeselModel.new
    end

    it "should be valid" do
     @model.should_not be_valid 
     @model.pesel = "44051401359"
     @model.should be_valid
    end
    
    it "should be invalid" do
      @model.pesel = "44051401353"
      @model.should_not be_valid
    end
  end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
common_numbers_rails-0.1.3 spec/pesel_validator_spec.rb
magick_numbers_rails-0.1.2 spec/pesel_validator_spec.rb
magick_numbers_rails-0.1.1 spec/pesel_validator_spec.rb