Sha256: b0e26dff3a5f4b8aef9f6eea49cc07de07cdcbc21ccf27d09847dbb7dc633b2c

Contents?: true

Size: 703 Bytes

Versions: 137

Compression:

Stored size: 703 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_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

137 entries across 137 versions & 1 rubygems

Version Path
canvas_sync-0.22.1 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.0 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.0.beta8 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.0.beta7 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.0.beta6 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.0.beta5 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.0.beta4 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.0.beta3 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.0.beta2 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.22.0.beta1 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.21.1 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.21.1.beta1 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.21.0 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.21.0.beta5 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.21.0.beta4 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.21.0.beta3 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.21.0.beta2 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.21.0.beta1 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.20.5 spec/canvas_sync/models/submission_spec.rb
canvas_sync-0.20.4 spec/canvas_sync/models/submission_spec.rb