Sha256: b649e7a5397c9a2127642c3160fb58d80352ff26967931ab6967ab4be7db89e1

Contents?: true

Size: 441 Bytes

Versions: 7

Compression:

Stored size: 441 Bytes

Contents

require 'spec_helper_models'

describe Gaku::StudentSpecialty do

  describe 'associations' do
    it { should belong_to :specialty }
    it { should belong_to :student }
  end

  describe 'validations' do
    it { should validate_presence_of :student_id }
    it { should validate_presence_of :specialty_id }
    it { should validate_uniqueness_of(:student_id).scoped_to(:specialty_id).with_message(/Specialty already added!/) }
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gaku-0.2.4 core/spec/models/student_speciality_spec.rb
gaku-0.2.3 core/spec/models/student_speciality_spec.rb
gaku-0.2.2 core/spec/models/student_speciality_spec.rb
gaku-0.2.1 core/spec/models/student_speciality_spec.rb
gaku-0.2.0 core/spec/models/student_speciality_spec.rb
gaku-0.1.1 core/spec/models/student_speciality_spec.rb
gaku-0.1.0 core/spec/models/student_speciality_spec.rb