Sha256: e81e32f610625422abc65a16d99607b88faaeded37e755ea7d55fc5f147ba9ec

Contents?: true

Size: 595 Bytes

Versions: 60

Compression:

Stored size: 595 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_section_id) }
    it { should validate_uniqueness_of(:canvas_section_id) }
  end

  describe 'associations' do
    it do
      should belong_to(:course)
        .with_primary_key(:canvas_course_id)
        .with_foreign_key(:canvas_course_id)
    end

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

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
canvas_sync-0.5.3 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.5.2 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.5.1 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.4.1 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.4.0 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.23 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.22 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.21 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.20 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.19 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.18 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.17 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.16 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.15 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.14 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.13 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.12 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.11 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.10 spec/canvas_sync/models/section_spec.rb
canvas_sync-0.3.9 spec/canvas_sync/models/section_spec.rb