Sha256: 4de41dd38dc9e80e5921a44f311f8d1cf81dfe8586c3206cf657c8e533701e99

Contents?: true

Size: 867 Bytes

Versions: 23

Compression:

Stored size: 867 Bytes

Contents

RSpec.describe ValidatesTimeliness, 'HelperMethods' do
  let(:record) { Person.new }
  
  it 'should define class validation methods' do
    expect(Person).to respond_to(:validates_date)
    expect(Person).to respond_to(:validates_time)
    expect(Person).to respond_to(:validates_datetime)
  end

  it 'should define instance validation methods' do
    expect(record).to respond_to(:validates_date)
    expect(record).to respond_to(:validates_time)
    expect(record).to respond_to(:validates_datetime)
  end

  it 'should validate instance using class validation defined' do
    Person.validates_date :birth_date
    record.valid?

    expect(record.errors[:birth_date]).not_to be_empty
  end

  it 'should validate instance using instance valiation method' do
    record.validates_date :birth_date

    expect(record.errors[:birth_date]).not_to be_empty
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
validates_timeliness-8.0.0.beta1 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-7.0.0 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-7.0.0.beta2 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-5.0.1 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-6.0.1 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-7.0.0.beta1 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-6.0.0 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-6.0.0.beta2 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-6.0.0.beta1 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-6.0.0.alpha1 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-5.0.0 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-5.0.0.beta2 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-5.0.0.beta1 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-5.0.0.alpha5 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-4.1.1 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-4.1.0 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-5.0.0.alpha4 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-5.0.0.alpha3 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-5.0.0.alpha2 spec/validates_timeliness/helper_methods_spec.rb
validates_timeliness-5.0.0.alpha1 spec/validates_timeliness/helper_methods_spec.rb