Sha256: 5b101b2df68db3c13e5196a4d0de4304c3e2990ae6c169ded65f32d7354d5bf6
Contents?: true
Size: 726 Bytes
Versions: 23
Compression:
Stored size: 726 Bytes
Contents
require 'spec_helper' RSpec.describe Course, type: :model do let(:subject) { FactoryGirl.create(:course) } describe 'validations' do it { should validate_presence_of(:canvas_course_id) } it { should validate_uniqueness_of(:canvas_course_id) } end describe 'associations' do it do should belong_to(:term) .with_primary_key(:canvas_term_id) .with_foreign_key(:canvas_term_id) end it do should have_many(:enrollments) .with_primary_key(:canvas_course_id) .with_foreign_key(:canvas_course_id) end it do should have_many(:sections) .with_primary_key(:canvas_course_id) .with_foreign_key(:canvas_course_id) end end end
Version data entries
23 entries across 23 versions & 1 rubygems