Sha256: 59b69f195ae451188b8205f17e7759ac745828c61ea73fef9e432e39c6005b47
Contents?: true
Size: 988 Bytes
Versions: 10
Compression:
Stored size: 988 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_id) } it { should validate_uniqueness_of(:canvas_id) } end describe 'associations' do it do should belong_to(:term) .with_primary_key(:canvas_id) .with_foreign_key(:canvas_term_id) end it do should have_many(:enrollments) .with_primary_key(:canvas_id) .with_foreign_key(:canvas_course_id) end it do should have_many(:sections) .with_primary_key(:canvas_id) .with_foreign_key(:canvas_course_id) end it do should have_many(:assignment_groups) .with_primary_key(:canvas_id) .with_foreign_key(:canvas_course_id) end it do should have_many(:assignments) .with_primary_key(:canvas_id) end it do should have_many(:submissions) end end end
Version data entries
10 entries across 10 versions & 1 rubygems