Sha256: 6d089a39bae3270c58bcd3ecf8ad0e8be8ecc08993817e5e8856a50f37b75424
Contents?: true
Size: 696 Bytes
Versions: 137
Compression:
Stored size: 696 Bytes
Contents
require 'spec_helper' RSpec.describe Enrollment, type: :model do let(:subject) { FactoryGirl.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
137 entries across 137 versions & 1 rubygems