Sha256: 65795acd1e19cb66dc10cf0716aff952450e4e713eff4a66e56feb2779deb601
Contents?: true
Size: 591 Bytes
Versions: 5
Compression:
Stored size: 591 Bytes
Contents
require 'spec_helper_models' describe Gaku::GradingMethodConnector do describe 'associations' do it { should belong_to :gradable } it { should belong_to :grading_method } end describe 'validations' do it { should validate_presence_of :grading_method_id } it { should validate_presence_of :gradable_id } it { should validate_presence_of :gradable_type } it { should validate_inclusion_of(:gradable_type).in_array(%w(Gaku::Exam Gaku::Course)) } it { should validate_uniqueness_of(:grading_method_id).scoped_to([:gradable_type, :gradable_id]) } end end
Version data entries
5 entries across 5 versions & 1 rubygems