Sha256: bbe167e8ac1b9c79fa90307833ec0f837395b51fa1ff06c079cc0502962c5021

Contents?: true

Size: 531 Bytes

Versions: 5

Compression:

Stored size: 531 Bytes

Contents

require 'spec_helper_models'

describe Gaku::SchoolYear do

  describe 'associations' do
    it { should have_many :semesters }
  end

  describe 'validations' do
    it { should validate_presence_of :starting }
    it { should validate_presence_of :ending }

    it 'validation error for ending before after' do
      school_year = Gaku::SchoolYear.create starting: Date.parse('2013-4-8'), ending: Date.parse('2013-4-7')
      school_year.valid?.should be_false
      school_year.should have(1).error_on(:base)
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gaku-0.2.4 core/spec/models/school_year_spec.rb
gaku-0.2.3 core/spec/models/school_year_spec.rb
gaku-0.2.2 core/spec/models/school_year_spec.rb
gaku-0.2.1 core/spec/models/school_year_spec.rb
gaku-0.2.0 core/spec/models/school_year_spec.rb