Sha256: 4b11e06e4a525e78a2aac354b0792748dceafda50d4517c84595f1877f8fd3ce

Contents?: true

Size: 607 Bytes

Versions: 127

Compression:

Stored size: 607 Bytes

Contents

require 'spec_helper'

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

  describe 'validations' do
    it { should validate_presence_of(:canvas_id) }
    it { should validate_uniqueness_of(:canvas_id) }
  end

  describe 'associations' do
    it { should have_many(:group_memberships) }

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

    it do
      should have_many(:submissions)
        .with_primary_key(:canvas_id)
        .with_foreign_key(:canvas_user_id)
    end
  end
end

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
canvas_sync-0.17.3.beta1 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.2 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.1 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta15 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta14 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta13 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta12 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta11 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta10 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta9 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta8 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta7 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta6 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta5 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta4 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.16.5 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta3 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta2 spec/canvas_sync/models/user_spec.rb
canvas_sync-0.17.0.beta1 spec/canvas_sync/models/user_spec.rb