Sha256: 74e3822b0bec3bc1c991da881516857a40b42444b98d99a0c0473e34c5836f4a

Contents?: true

Size: 748 Bytes

Versions: 35

Compression:

Stored size: 748 Bytes

Contents

require "spec_helper"

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

  describe "validations" do
    it { should validate_presence_of(:canvas_submission_id) }
    it { should validate_uniqueness_of(:canvas_submission_id) }
  end

  describe 'associations' do
    it do
      should belong_to(:user)
        .with_primary_key(:canvas_user_id)
        .with_foreign_key(:canvas_user_id)
    end

    it do
      should belong_to(:assignment)
        .with_primary_key(:canvas_assignment_id)
        .with_foreign_key(:canvas_assignment_id)
    end

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

end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
canvas_sync-0.9.4 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.9.3 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.9.2 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.9.1 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.9.0 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.8.4 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.8.3 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.8.2 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.8.1 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.8.0 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.7.3 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.7.2 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.7.1 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.7.0 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.6.4 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.6.3 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.6.2 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.6.1 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.6.0 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.5.4 spec/canvas_sync/models/submission_spec.rb