Sha256: 09361c075a3024c7ae160819b1ba15f90b9b6ee3e9115e05aace77ec29e97667

Contents?: true

Size: 702 Bytes

Versions: 7

Compression:

Stored size: 702 Bytes

Contents

require "spec_helper"

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

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

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

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

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
canvas_sync-0.22.9 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.8 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.6 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.5 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.4 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.3 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.2 spec/canvas_sync/models/submission_spec.rb