Commit Graph

10 Commits

Author SHA1 Message Date
Spencer Olson 4c0f40f056 bump switchman
refs AE-1
flag=none

Test Plan:
- specs pass

Change-Id: I453a678d5204dde2a562f4fceff8393c289ecab1
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/314826
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Build-Review: Cody Cutrer <cody@instructure.com>
2023-03-31 17:08:16 +00:00
Cody Cutrer c2cba46851 RuboCop: Style/StringLiterals, Style/StringLiteralsInInterpolation
[skip-stages=Flakey]

auto-corrected

Change-Id: I4a0145abfd50f126669b20f3deaeae8377bac24d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279535
Tested-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:03:06 +00:00
Cody Cutrer e73cf9ddf4 RuboCop: Style/HashSyntax
[skip-stages=Flakey]

auto-corrected

Change-Id: I9371a61046aee6b148f89dd434114a8ba2b1188c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279533
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
2021-11-25 14:02:35 +00:00
Cody Cutrer 9b71ed2054 RuboCop: Style/BlockDelimiters, Style/Lambda
[skip-stages=Flakey]

auto-corrected

Change-Id: I642f868d75c079e698f1fe4161bbbe419dbe1827
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/279374
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Migration-Review: Cody Cutrer <cody@instructure.com>
2021-11-23 21:30:47 +00:00
Cody Cutrer 47119da659 spec: remove sharding_spec_helper requires
[skip-stages=Flakey]

the main spec_helper already requires it

Change-Id: Ibcd905aa7ae603c8cdfa3cd24216e16aee252a8f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276853
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-28 00:19:18 +00:00
Cody Cutrer 0a025efa2f spec: use require_relative instead of require File.expand_path
[skip-stages=Flakey]

Change-Id: I861a46acffa893b4ea6630039da66851c71b5a77
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/276831
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jacob Burroughs <jburroughs@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-10-28 00:15:03 +00:00
Cody Cutrer 8e0327867e RuboCop: Layout spec/models
[skip-stages=Flakey]

Change-Id: I25b7f97dc3bb7fd9f24e63e372d7127c42cd3147
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/274147
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2021-09-22 19:17:48 +00:00
Cody Cutrer 81d0bbc465 add # frozen_string_literal: true for specs
Change-Id: Id508bec1817937b1c24c29f1db7221e09cb9c2ab
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/251157
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2020-10-27 20:48:35 +00:00
Clint Furse b6fd189d97 set root_account_id on attachment create
closes LA-791
flag = none

Test Plan:
- verify that attachments can still be created
- when adding an attachment, verify the root_account_id is set
   when related to a context with a root_account_id

Change-Id: Ic294aad654deb5c154d0396bcc99565720fbd07b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/238602
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Clint Furse <cfurse@instructure.com>
2020-06-01 21:46:48 +00:00
Landon Gilbert-Bland 7c59c834b5 SubmissionDraft model initial commit
This is the first part of submission drafts that only account for file
uploads. Other types (body, media comments, etc) will be coming in
future commits.

Fixes COMMS-2050

Test Plan:
  - Migrate your database with this patchset checked out
    `bundle exec rake db:migrate:up VERSION=20190503151652`
  - Have some attachments in your database
  - Have a course with a studnet in it
  - Create and publish a new assignment in this course
  - Open the rails console, and notice that the submission for the
    student does not have any submission drafts associated with it

    ```
    s = Submission.last
    s.submission_drafts.empty?  # Should be true
    ```

  - Create a new submission draft with some attachments in the console,
    and notice that you can see the draft and attachmetns from the
    submission

    ```
    draft = SubmissionDraft.new(submission_attempt: 0)
    submission = Submission.last
    submission.submission_drafts << draft
    attachments = Attachment.limit 3
    draft.attachments = attachments

    submission.submission_drafts # Should show the new draft
    submission.submission_drafts.first.attachments # The attachments
    ```

  - From the web ui, submit the assignment as the student.

  - Back in the rails console, and notice that the submission draft
    has now been deleted

    ```
    submission.reload
    submission.submission_drafts # Should now be []
    SubmissionDraft.count # Should be 0
    SubmissionDraftAttachment.count # Should be 0
    ```

  - Notice that the attachments in the rails console have not been
    deleted.

    ```
    attachments.each(&:reload)
    attachments.map(&:persisted?) # Should all be true
    ```

  - Make sure you cannot create a draft that has a higher attempt then
    the  root submission:

    ```
    SubmissionDraft.create!(
      submisison: submission,
      submission_attempt: 0
    )  # Should raise a RecordInvalid error
    ```

  - Undo the database migration until this gets merged.
    `bundle exec rake db:migrate:down VERSION=20190503151652`

Change-Id: Ibedda3719e582b3aa67f049699603f3fc7cbc145
Reviewed-on: https://gerrit.instructure.com/192212
Tested-by: Jenkins
QA-Review: Matthew Lemon <mlemon@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Landon Gilbert-Bland <lbland@instructure.com>
2019-05-17 14:42:08 +00:00