docbrown/spec
Julianna Tetreault c87974b7ac
[deploy] Add co_author_ids to Articles (#10339)
* Replaces second_user_id and third_user_id with co_author_ids on the Articles table

* Adjusts migration that adds co_author_ids to also add array: true

* Replaces second_user_id and third_user_id with co_author_ids in all applicable files
  - Use co_author_ids in _individual_article view
  - Use co_author_ids in articles and stories controllers
  - Use co_author_ids in article and podcast_episode models
  - Use co_author_ids in article_dashboard
  - Use co_author_ids in comments_helper
  - Use co_author_ids in articles_spec

* Replaces second_user_id and third_user_id with co_author_ids in article.rb model

* Remove unused #assign_co_authors method from the Stories::Controller

* Add #co_authors and #co_author_name_and_path to article_decorator.rb

* Adds a descriptive form field for co_author_ids for Admins in /admin/articles

* Adds a conditional in article/show.html.erb to render co_author names on an Article in a human-readable way

* Replaces get_co_author_name_and_path with proper method name, co_author_name_and_path in show.html.erb

* Adds latest schema to (hopefully) resolve Travis conflicts

* Adds the safe operator to show.html.erb

* Adjusts articles_spec.rb to use an array in the first test

* Replaces unless &.empty? with if ./present? in articles/show.html.erb

* Replaces second_user_id with co_author_ids in stories_show_spec.rb test

* Replaces elsif with else in articles/show.html.erb

* Cleans up show.html.erb by removing conditional in favor of decorator method

* Refactors splitting of params in Articles::Controller and optimizes query in #co_authors

* Reverts removal of second_user_id and third_user_id and migration file

* Adds a data_update script to update co_author_ids with existing second and third user_ids

* Adds validations to co_authors and flash_messages to indicate whether an update was successful or not
  - Adds to methods to article.rb to validate the IDs of co_authors and authors
  - Adds flash messages to the Admin::Articles::Controller and a redirect to the show page
  - Removes the JS highlighting upon submit when updating an Article in Admin
  - Refactors #update action in Admin::Articles::Controller

* Adds tests to article_spec.rb around co_author_id validations in article.rb

* Adjusts #validate_co_authors_must_not_be_the_same to use .include? instead

* Uses Field::Select.with_options in article_dashboard.rb to properly display co_author_ids

* Reverts removal of assigning co_author_ids in the Stories::Controller

* Adjusts error message and adjusts return logic in article.rb (thanks, Fernando!)

* Fixes failing article_spec.rb test that checks for co_author_ids uniqueness

* Adds a default array to co_author_ids and checks if they are .blank?

* Refactor data_update script to use a single SQL statement (thank you, Michael)

* Preserve array order of co_author_ids in article_decorator.rb

* Add db file for default: []

* Add validation to fix bug related to text inputs and invalid users when adding co_authors

* Adds tests to ensure that co_author_ids are both an integer and an integer > 0

* Updates admin/articles_spec.rb to default [] instead of nil

* Adjusts validations in article.rb to be DRY-er and more consistent

* Consolidates validations further

* Refactors validations in article.rb to use procs

* Refactors data_update script to remove nil values from array
2020-10-02 11:06:11 -04:00
..
black_box Routine rubocop fixes (#10237) 2020-09-08 12:06:47 -04:00
decorators [deploy] Enable admin-configured app_domain (#10206) 2020-09-11 09:38:34 -04:00
factories [deploy] Add missing FKs to BadgeAchievements BanishedUsers BufferUpdates (#10366) 2020-09-29 21:43:14 +02:00
fixtures Removed the autoprefixer-rails deprecated gem (#10017) 2020-08-26 17:38:24 -04:00
helpers [deploy] Enable admin-configured app_domain (#10206) 2020-09-11 09:38:34 -04:00
initializers [deploy] Refactor:Change Unset Var Warnings to Debug Level (#9985) 2020-08-25 09:45:42 +02:00
labor [deploy] Return Cache Bust Response When Busting a Cached Path (#10500) 2020-09-30 17:17:04 -05:00
lib Handling links from different domain (#10479) 2020-09-29 13:36:32 -04:00
liquid_tags Fix bug that arises when a previously tagged comment is deleted (#10486) 2020-09-29 13:43:25 -04:00
mailers [deploy] Add community_name to site config (#9864) 2020-08-19 14:54:40 -04:00
models [deploy] Add co_author_ids to Articles (#10339) 2020-10-02 11:06:11 -04:00
policies [deploy] [Admin Tooling] Allow admins unpublish articles from the Mod Actions Panel (#10038) 2020-09-02 16:08:08 -05:00
queries/admin Fixes 500 error when viewing the "Tag Mods" page without having the role on the database (#10515) 2020-10-01 12:55:25 -06:00
requests [deploy] Add co_author_ids to Articles (#10339) 2020-10-02 11:06:11 -04:00
routing Add routes for i18n (#10193) 2020-09-03 17:11:07 -04:00
serializers/search [deploy] Refactor:Remove Reaction Search Code (#10377) 2020-09-23 12:27:50 -05:00
services Slack notification with reminder to delete user gdpr data (#10532) 2020-10-02 10:12:12 -04:00
support GitHub liquid tag: add support for img tags with no src attribute (#10470) 2020-09-29 10:37:53 +02:00
system Spec Fix:Dont Reuse Same Username and Let Factory Set Title (#10519) 2020-10-01 17:10:27 -05:00
tasks Refactor:Send Welcome Broadcast Notifications From Sidekiq (#9923) 2020-08-21 12:57:08 -04:00
uploaders Flaky Spec Fix:Remove let_it_be Test Prof Helper (#9556) 2020-07-29 11:31:01 +02:00
view_objects Enable Rubocop 0.89 cops and fix Lint/ violations (#9709) 2020-08-10 16:57:12 +02:00
views Update Imgproxy to use predetermined endpoint (#10412) 2020-09-28 18:30:29 -04:00
workers Slack notification with reminder to delete user gdpr data (#10532) 2020-10-02 10:12:12 -04:00
rails_helper.rb [deploy] Allow initial user to sign up and configure app (#10073) 2020-08-31 12:54:22 -04:00
spec_helper.rb Manually load dotenv in test (#9971) 2020-08-24 20:19:03 +02:00