Sha256: f31a20fdcc45b1dee42d5a3abd4a1f783a16012c9bc70d7ad61915b72439f933

Contents?: true

Size: 527 Bytes

Versions: 5

Compression:

Stored size: 527 Bytes

Contents

require 'spec_helper_models'

describe Gaku::CourseGroupEnrollment do

  describe 'associations' do
    it { should belong_to :course_group }
    it { should belong_to :course }
  end

  describe 'validations' do
    it { should validate_presence_of :course_group_id }
    it { should validate_presence_of :course_id }
    it do
      should validate_uniqueness_of(:course_id).scoped_to(:course_group_id)
                                               .with_message(/Already enrolled to this course group!/)
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

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