Sha256: 6e5f02563cdc1282c0835e250636483d2712b23e83b175a7e17f43159d4512d9

Contents?: true

Size: 564 Bytes

Versions: 137

Compression:

Stored size: 564 Bytes

Contents

require 'spec_helper'

RSpec.describe Section, type: :model do
  let(:subject) { FactoryGirl.create(:section) }

  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(:course)
        .with_primary_key(:canvas_id)
        .with_foreign_key(:canvas_course_id)
    end

    it do
      should have_many(:enrollments)
        .with_primary_key(:canvas_id)
        .with_foreign_key(:canvas_section_id)
    end
  end
end

Version data entries

137 entries across 137 versions & 1 rubygems

Version Path
canvas_sync-0.17.0.beta1 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.16.4 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.16.3 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.16.2 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.16.1 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.15.1 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.15.0 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.14.0 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.13.0 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.12.0 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.11.0 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.10.6 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.10.5 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.10.4 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.10.3 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.10.2 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.10.0 spec/canvas_sync/models/section_spec.rb