Sha256: b0480c9b81c08bfc576da85da5e70ebe0e5f01355d4ccd5c630694c0a10c9d33
Contents?: true
Size: 695 Bytes
Versions: 7
Compression:
Stored size: 695 Bytes
Contents
require 'spec_helper' RSpec.describe Enrollment, type: :model do let(:subject) { FactoryBot.create(:enrollment) } 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(:user) .with_primary_key(:canvas_id) .with_foreign_key(:canvas_user_id) end it do should belong_to(:course) .with_primary_key(:canvas_id) .with_foreign_key(:canvas_course_id) end it do should belong_to(:section) .with_primary_key(:canvas_id) .with_foreign_key(:canvas_section_id) end end end
Version data entries
7 entries across 7 versions & 1 rubygems