canvas-lms/lib/cdc_migration_testing/fixtures
Tucker McKnight f9fa2d57a0 spec: Throw a ForeignKeyNotSatisfied if an assignment doesn't exist
When creating an AssignmentOverride for the CDC schema tests,
it currently fills in 1 for assignment_id.

Any required integer field is auto-filled with a 1, so we're
assuming that an assignment exists with an ID of 1. This isn't
a safe assumption, so look for an actual assignment instead, and
throw a ForeignKeyNotSatisfied error if there isn't one yet.

(ForeignKeyNotSatisfied will push this model to the back of the queue
and try to create it later, after other models have been created.)

Change-Id: I6dea6e5e6e0c553a3ba261f47565fc1dda95ce7f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248890
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Evan Battaglia <ebattaglia@instructure.com>
QA-Review: Tucker Mcknight <tmcknight@instructure.com>
Product-Review: Tucker Mcknight <tmcknight@instructure.com>
2020-09-30 18:48:22 +00:00
..
assignment_override.rb spec: Throw a ForeignKeyNotSatisfied if an assignment doesn't exist 2020-09-30 18:48:22 +00:00
enrollment.rb Add a rake task that inserts rows into all db tables 2020-03-10 22:54:50 +00:00
profile.rb Add a rake task that inserts rows into all db tables 2020-03-10 22:54:50 +00:00
web_conference.rb spec: Set empty settings hash when creating a PluginSetting 2020-04-21 21:02:44 +00:00
wiki_page.rb Add a rake task that inserts rows into all db tables 2020-03-10 22:54:50 +00:00