Sha256: fe9ae9630a302bba02ae366f1e768074017088036b1c727a09cfa65107e02c9b

Contents?: true

Size: 590 Bytes

Versions: 137

Compression:

Stored size: 590 Bytes

Contents

require 'spec_helper'

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

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

Version data entries

137 entries across 137 versions & 1 rubygems

Version Path
canvas_sync-0.17.14 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.13 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.12 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.10.beta2 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.10.beta1 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.8 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.8.beta4 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.8.beta3 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.8.beta2 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.8.beta1 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.7 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.7.beta1 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.6 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.6.beta1 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.5 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.5.beta2 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.5.beta1 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.4 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.3.beta3 spec/canvas_sync/models/assignment_group_spec.rb
canvas_sync-0.17.3.beta2 spec/canvas_sync/models/assignment_group_spec.rb