Sha256: 9eb88e97c85259fa84708fd6be2b7e45fa3492368819c52c6c1e876973ae0565

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

require 'spec_helper'

describe ValidatesTimeliness, 'HelperMethods' do
  it 'should define class validation methods' do
    Person.should respond_to(:validates_date)
    Person.should respond_to(:validates_time)
    Person.should respond_to(:validates_datetime)
  end

  it 'should define instance validation methods' do
    Person.instance_methods.should include('validates_date')
    Person.instance_methods.should include('validates_time')
    Person.instance_methods.should include('validates_datetime')
  end

  it 'should validate instance when validation method called' do
    r = Person.new
    r.validates_date :birth_date
    r.errors[:birth_date].should_not be_empty
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validates_timeliness-3.0.0.beta.4 spec/validates_timeliness/helper_methods_spec.rb