canvas-lms/spec/migrations
Simon Williams 9ca3e49bf8 cleanup and prevent duplicate external feeds
this commit does three things:
* runs a data migration to delete duplicate external feeds.  duplicates
  are defined as having the same context, url, verbosity, and header match
* prevents duplicates from being created on course copy, by searching
  for and re-using an existing feed if it exists when importing
* validating uniqueness of newly created/saved external feeds, and
  exposing validation errors in the UI

fixes CNVS-17523

test plan:
- before downloading this commit, create two courses, go to the
  announcments pages, and create several different external feeds, some
  of which only duplicate the url (but have differences for other values)
  and some of which are exact duplicates
- checkout this patchset, run migrations
- those courses should now only have unique feeds (the full duplicates
  will be deleted)
- now try creating a new full duplicate
- you should get an error message that says "taken" on the url field
- try importing the feeds from a course with a feed into another course
  that has the exact same external feed
- it should succeed, but not create a duplicate feed in the second course

Change-Id: If1655283102a74626c4579c24382cde92115e776
Reviewed-on: https://gerrit.instructure.com/45991
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-02-13 17:35:34 +00:00
..
add_context_to_content_exports_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
add_manage_rubrics_permission_spec.rb new roles 2014-10-31 19:44:14 +00:00
add_manage_storage_quotas_permission_spec.rb new roles 2014-10-31 19:44:14 +00:00
add_pseudonym_to_student_view_students_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
add_role_id_columns_spec.rb fix add_role_id_columns migration for missing roles 2014-11-26 13:52:48 +00:00
add_role_overrides_for_new_permission_spec.rb fix add role overrides for new permission datafixup 2014-12-17 17:59:31 +00:00
change_enrollments_role_id_null_spec.rb fix ChangeEnrollmentsRoleIdNull 2014-12-23 19:52:39 +00:00
cleanup_duplicate_external_feeds_spec.rb cleanup and prevent duplicate external feeds 2015-02-13 17:35:34 +00:00
create_context_external_tool_placements_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
disable_open_registration_for_delegated_auth_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
filter_page_view_url_params_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_broken_file_links_in_assignments_spec.rb more no more dynamic finders 2014-11-04 18:57:05 +00:00
fix_bulk_message_attachments_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_content_tags_without_content_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_dissociated_discussion_topics.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_group_discussion_submissions_spec.rb resolves group discussion entries not appearing in gradebook and speedgrader 2014-12-29 18:20:51 +00:00
fix_imported_wiki_page_workflow_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_incorrect_attachment_file_state_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_incorrect_published_states_on_quizzes_and_assignments_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_media_recording_submission_types_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_out_of_sync_outcome_alignments_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_root_outcome_group_titles_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_user_conversations_counts_for_all_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_user_merge_conversations2_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
fix_user_merge_conversations_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
link_missing_sis_observer_enrollments_spec.rb datafix missing observer enrollments from sis imported enrollments 2014-11-13 23:01:39 +00:00
move_content_export_notifications_to_migration_category_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
move_scribd_docs_to_root_attachments_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
populate_conversation_message_properties.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
populate_conversation_root_account_ids_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
populate_group_category_on_discussion_topics_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
populate_overridden_due_at_for_due_date_cacher.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
populate_submission_versions_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
reassociate_conversation_attachments_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
recalculate_muted_assignments_spec.rb 1.9 spec fixes 2012-05-18 12:36:48 -06:00
reintroduce_deleted_entries_to_unread_count_spec.rb more no more dynamic finders 2014-11-04 18:57:05 +00:00
remove_bogus_enrollment_associated_user_ids_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
remove_extraneous_conversation_tags_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
remove_multiple_root_folders_spec.rb more no more dynamic finders 2014-11-04 18:57:05 +00:00
remove_orphaned_context_module_progressions_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
resanitize_assignments_allowed_extensions_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
reset_ungraded_counts_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
set_account_lti_opaque_ids_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
set_saml_entity_id_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
undelete_some_outcome_alignments_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00
unify_active_assignment_workflow_states_spec.rb rspec 3-ify spec/migrations 2014-10-13 22:41:07 +00:00