Closes: GRADE-892
test plan
- anonymous_id is present on the submissions table
- cannot create a submission with the same assignment id and
anonymous_id.
account = Account.default
course = account.courses.create!
assignment = course.assignments.create!
first_user = User.create!
second_user = User.create!
assignment.submissions.create!(
user: first_user,
anonymous_id: 'abcd1'
)
# fails
assignment.submissions.create!(
user: second_user,
anonymous_id: 'abcd1'
)
The error message is of the form: `ActiveRecord::RecordNotUnique:
PG::UniqueViolation: ERROR: duplicate key value violates unique
constraint "index_submissions_on_assignment_id_and_anonymous_id"`
Change-Id: I74dc28d4e5a226960750647774f20c67d2772f1c
Reviewed-on: https://gerrit.instructure.com/142344
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>