Commit graph

57 commits

Author SHA1 Message Date
Jacob Herrington
d479834344
Do not set SiteConfig values in specs (#11125) 2020-10-27 15:56:31 -04:00
Jacob Herrington
c91c07920f
Add config option for Forem collective noun (#11107)
Not everyone will want to use "Community" to describe their Forem, so
now they have some flexibility there.
2020-10-27 12:45:52 -04:00
Vaidehi Joshi
c4efee10bf
Do not require meta_keywords to be set (#10721)
* Remove extra character from meta_keywords in /listings/index.html.erb

* Remove meta_keywords from MANDATORY_CONFIGS

* Add and use meta_keywords_tag helper

* Use modern tag syntax instead of deprecated syntax

* Add and use meta_keywords_default helper

* Add and use meta_keywords_article helper

* Remove * from meta_keywords_field.label

* Update meta_keyword specs to account for no keywords being set
2020-10-08 10:51:25 -04:00
Vaidehi Joshi
52fd043c33
[deploy] Limit articles created by newer users (#10686)
* Limit articles created by newer users

* Fix typo in test
2020-10-06 21:02:05 -04:00
Mac Siri
9ebd742712
[deploy] Reintroduce sticky_nav changes (ab81f36 & 7f92855) (#10263)
* Revert "[deploy] Revert removal of unneeded eager load (if needed) (#10179)"

This reverts commit 11c7b148da.

* Revert "[deploy] Revert "Migrate ProfileImage to Images::Profile (#10055)" (#10149)"

This reverts commit 5657067e55.
2020-09-09 15:33:13 -04:00
Arit Amana
b79766f697
[deploy] [Admin Tooling] Allow admins unpublish articles from the Mod Actions Panel (#10038) 2020-09-02 16:08:08 -05:00
Molly Struve
5657067e55
[deploy] Revert "Migrate ProfileImage to Images::Profile (#10055)" (#10149)
This reverts commit ab81f36a38.
2020-09-01 18:28:58 -05:00
Mac Siri
ab81f36a38
[deploy] Migrate ProfileImage to Images::Profile (#10055) 2020-09-01 17:16:03 -04:00
rhymes
36358293ce
[deploy] Add foreign keys to models related to Organization (#9933)
* Add foreign keys to models related to Organization

* Fix specs

* Use on_delete: :cascade for listings -> organizations FK
2020-08-25 20:20:47 +02:00
Mac Siri
76de9a0317
[deploy] Replace #cloudinary with #optimized_image_url (#9876) 2020-08-21 14:46:00 -04:00
Ben Halpern
6c71369df5
[deploy] Add community_name to site config (#9864)
* Add community_name to site config

* Fix a spec

* Remove SiteConfig from constants

* Change subjects to method

* Fix subjects method

* Fix linting
2020-08-19 14:54:40 -04:00
rhymes
f5d35c6506
Rubocop: Enable and fix Style/StringConcatenation (#9844) 2020-08-18 14:50:15 +02:00
Vaidehi Joshi
63816035bb
Add X-Accel-Expires header to support Nginx caching (#9655) [deploy]
* Replace  in Cache-Control header to support Nginx caching

* Add 'X-Accel-Expires' header for Nginx caching

* Remove max-age directive from remaining specs

* Update caching header specs to test against x-accel-expires header
2020-08-13 14:24:50 -07:00
Molly Struve
b40af82b66
Flaky Spec Fix:Remove let_it_be Test Prof Helper (#9556)
* Flaky Spec Fix:Remove let_it_be Test Prof Helper

* Spec cleanup and fixes
2020-07-29 11:31:01 +02:00
Molly Struve
bc5e114ce9
Flaky Spec Fix:Remove let_it_be To Prevent Bad Database State Failing Specs (#9512) 2020-07-26 12:32:32 -05:00
rhymes
5b62811c98
[deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
Michael Kohl
fb27f52ed0
[deploy] Display banner if site hasn't been configured (PRE DEPLOYMENT TASKS) (#8435) 2020-07-07 07:37:04 -05:00
rhymes
a3bfb375ef
Routine rubocop fixes (#9155)
* Refactoring and rubocop -a

* rubocop --auto-gen-config
2020-07-06 15:15:34 +02:00
Molly Struve
5d22e71ad6
nothing to see here....except maybe reverting a push to master (#8308)
🙈
2020-06-05 20:34:21 -05:00
mstruve
533cab50d6 synchronous roles 2020-06-05 20:02:41 -05:00
Mac Siri
1b839d9328
[deploy] Streamline Tag parsing for both editors (#8175) 2020-06-05 08:46:24 -04:00
Ernesto Tagwerker
9ea3a8c67d
Upgrade to Rails 6.0 (#7658)
* Add dual booting logic to Gemfile

This might be helpful for the Rails 6.0 upgrade project.

* Add more than one gemfile to Travis' configuration

We want to see how the application behaves with more than one Rails versions:

- Gemfile -> Rails 5.2
- Gemfile.next -> Rails 6.0

This will help us figure out what needs to be addressed before migrating to Rails 6.0.

If you want to read more about this technique (dual booting) you can check out this page: https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html

* Fix joins

* Upgrade Gemfile.next.lock

* Make sure we're installing the correct versions of gems

* Add Rails 6 notes

* Update rubocop in Gemfile.next.lock

* Fix organization spec

* Fix page_views_spec

* Add Rails 6 and run rails app:update

* Remove some tricks

* Remove Gemfile.next for now

* Fix .content_type deprecation

* Fix deprecation of .where.not NAND/NOR behavior

* Fix deprecation of parameterized emails

* Fix specs

* Remove next flag for now

* Fix spec (hopefully)

* Add wait_for_javascript

* Fix spec, thanks @maestromac!

* Try without wait for javascript hack

* Remove unnecessary bin/update

* Remove file that snuck in the rebase

* Update the vendored gems

* Replace migrate+db:setup with db:prepare

* Update vendored gems

* Fix Gemfile.lock and update vendored stuff

* Fix Gemfile.lock to be the same as master's minus the changes

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-06-04 11:54:25 +02:00
Fernando Valverde
b722c428da
Adds explicit quality params to cloudinary helper calls when specifying format (#8253) 2020-06-03 17:13:37 -04:00
ludwiczakpawel
a161d3ce31
[deploy] Redesign article editor (#7524) 2020-05-29 11:59:37 -04:00
rhymes
0976132425
[deploy] RSS feed: add article tags as categories (#8046) 2020-05-26 15:51:33 -04:00
rhymes
7db40b2117
[deploy] Add unique indexes - part 3 (#8050) 2020-05-26 08:34:53 -05:00
Jacob Herrington
03bf1ac45e
Use build_stubbed where possible in tests (#7827)
I got a little sidetracked and found a few places where we could use
build_stubbed.
2020-05-14 10:56:29 +02:00
Julianna Tetreault
ab248edfe5
Refactor articles_show_spec to Better Test JSON-LD (#7733)
* Refactor articles_show_spec.rb to better test JSON data
  * Adds additional tests around JSON-LD data
  * Removes original tests for JSON-LD from articles_show_spec

* Add org data to spec to test against actual JSON-LD data
  * Removes inline variables in favor of let declarations
  * Adds and tests organization structured data
  * Removes unnecessary objs and variables from spec

* Adjust org JSON-LD description in the Stories::Controller
  * Replaces user summary with org summary in org data structure

* Capitalize the S in RSpec in articles_show_spec.rb

* Remove OR from dateModified in favor of published_timestamp
2020-05-08 10:16:41 -06:00
Molly Struve
62290759e9
[deploy] Refactor Checking Rate Limits and Their Retry After settings (#7674) 2020-05-05 09:13:27 -05:00
Molly Struve
ba0ebbafa8
[deploy] RateLimit Refactor: Consolidate Logic for Checking a Limit and Raising an Error (#7636) 2020-05-01 13:31:44 -05:00
Alex
c222f78760
[deploy] Turn off broken article show spec - date time (#7634)
* Turn off broken spec

* Restore original spec
2020-04-30 15:17:07 -04:00
Alex
01d4972962
[deploy] Temporary article show date time spec fix (#7633) 2020-04-30 14:32:30 -04:00
Molly Struve
1d6c1fe445
load article page AFTER updating the article (#7627) 2020-04-30 10:54:55 -05:00
Anna Buianova
346ce44169
[deploy] Configurable meta keywords (#7591)
* Added configurable meta keywords

* Replaced hardcoded meta-keywords with the configurable ones

* Added tests for configurable meta_keywords

* Improve info for configuring meta-keywords
2020-04-29 09:40:06 -04:00
rhymes
0186fd9aee
Add Retry-After for API rate limit errors and document limits in API spec (#7444)
* Add correct rate limit exception to Articles::Updater

* Send Retry-After with HTTP 429 back to the client

* Update API specs for error 429

* Test build

* Fix spec

* Add retry after to ImageUploadsController and fix specs

* Generalize a bit
2020-04-24 17:35:28 +02:00
Molly Struve
de88a08ebd
[deploy] handle rate limit errors gracefully (#7422) 2020-04-22 08:55:26 -05:00
Ben Halpern
2c6a4b4ecf
[deploy] Make adjustments in ld+json logic (#7307)
* Make adjustments in ld+json logic

* Add github url
2020-04-15 15:50:48 -04:00
Julianna Tetreault
fd9fdebc0b
[deploy] Migrate from Schema.org to JSON-LD (#6956)
* Add JSON-LD in place of schema.org in _video_player.html.erb

* Remove unnecessary tags around JSON-LD to clean up templates

* Fix indenatation and remove extra elements from show.html.erb and _profile_header.html.erb

* Remove empty line from articles/show.html.erb

* Clean up JSON-LD commas across erb templates

* Revert articleBody changes, adjust nesting, and remove extra quote

* Add application/ld+json to allowed_types in .erb-lint.yml

This addition makes it so that the no verify flag is no longer required

* Add additional data for Articles, Users, and Orgs to better SEO

* Add additional data to JSON-LD structures
*Add sameAs data to articles/show.html.erb
*Add sameAs data to users/show.html.erb
*Make adjustments to VideoObject data in _video_player
*Make adjustments to Org in _profile_header
*Add removed erb back to all erb templates

* Refactor code to fix syntax Google syntax errors
* Add missing double quotes to values
* Remove unnecessary meta tags from _video_player.html.erb
* Add additional key-value pairs to data structures
* General code clean up

* Clean up existing data structures
  *Remove useless meta tag and replace with a tag
  *Small refactor to users/show.html.erb data

* Extract user json-ld out of users/show.html.erb
  *Move json-ld logic to stories_controller
  *Use user_json_ld variable in place of entire data structure
  *Set user_json_ld as a before_action in the controller

* Add specs around JSON-LD data in templates
  *Add request spec for users/show.html.erb
  *Add request spec for articles/show.html.erb
  *Add request spec for _video_player.html.erb
  *Add request spec for _profile_header.html.erb
  *WIP: Fix pending specs for all templates

* Remove useless meta tags from users/show and _profile_header.html.erb

* Add additional test coverage to users/show.html.erb
  *Add additional tests to user_show_spec
  *Ensure that all tests pass
  *Small refactor to users/show.html.erb JSON data structure

* Add additional test coverage around JSON-LD data
  *Add more robust tests to template specs
  *Remove unnecessary comments from specs
  *Uncomment pending specs

* Adjust modified date to be more readable in article specs

* Refactor spec to be more readable and update GitHub username test

* Remove meta erb from articles/show.html.erb

* Remove meta data from _video_player.html.erb

* Clean up useless codeand whitespace for final review

* Extract users/show data structure from template into StoriesController
  * Remove JSON-LD object from users/show.html.erb
  * Place JSON-LD for users/show.html.erb in StoriesController
  * Store user_json_ld in set_json_ld method in StoriesController
  * Call user_json_ld variable in script tag in users/show
  * Clean up trailing commas and refactor articles/show.html.erb
  * Remove redundant user/profile_header_spec.rb

* Remove unnecessary code from _profile_header and articles/show
  * Remove Organization from articles/show.html.erb
  * Remove unnecessary comments from _profile_header.html.erb

* Extract user_json_ld into separate methods to fix Code Climate failures

* Rename user_profile_details and user_same_as methods to be more explicit

* Refactored user_json_ld methods to use symbols instead of strings
  * Use symbols to fetch keys from a hash instead of strings
  * Changed user_url in data structure

* Removal of erb tags and general clean up

* Revert schema changes

* Remove unnecessary quotation marks
2020-04-15 15:03:05 -04:00
Ben Halpern
358edf8817
Add canonical url to /new (#7206) 2020-04-10 12:49:00 -04:00
Alex
441cd4f7db
[deploy] Update manual Fastly header assignments (#7119) 2020-04-07 13:22:32 -04:00
Julianna Tetreault
f6478fb7cc
Replace peform_enqueued_jobs with sidekiq_perform_enqueued_jobs in specs (#6454)
* Replace peform_enqueued_jobs with sidekiq_perform_enqueued_jobs in specs

* Fix typo in reaction_spec
2020-03-04 11:39:48 -07:00
Ben Halpern
883264c8ab
Do not render or link to empty rss feeds (#6429) [deploy]
* Do not render or link to empty rss feeds

* Fix tests up
2020-03-03 21:37:51 -05:00
rhymes
207621f739
Ignore User.organization_id (#6203)
* Ignore User.organization_id

* Fix specs that are still using organization_id
2020-02-21 09:51:49 -05:00
rhymes
bc385ae6d5
Switch decorators to Rails builtin decorations - take 2 (#6125) [deploy]
* Revert "Revert "[deploy] Switch decorators from Draper to Rails builtin decorations (#6040)" (#6122) [deploy]"

This reverts commit d438349550.

* Enable serialization for decorators

* Refactor and test default home feed serialization

* Improve spec

* Applied @vaidehijoshi suggestions

* Applied @citizen428 suggestions

* Make CodeClimate happy

* Cleanup stories_index_spec.rb

* Refactor UserDecorator#cached_followed_tags to loop less
2020-02-19 15:30:53 -05:00
rhymes
d438349550
Revert "[deploy] Switch decorators from Draper to Rails builtin decorations (#6040)" (#6122) [deploy]
This reverts commit cc53b55a4a.
2020-02-17 11:28:32 -05:00
rhymes
cc53b55a4a
[deploy] Switch decorators from Draper to Rails builtin decorations (#6040)
* Convert SponsorshipDecorator to Rails decorator

* Remove empty ReactionDecorator

* Rename SponsorshipDecorator#level_color_hex to level_background_color

* Convert CommentDecorator to Rails decorator

* Add specs and fix bugs for NotificationDecorator

* Convert NotificationDecorator to Rails decorator

* Add specs and fix bugs for OrganizationDecorator

* Convert OrganizationDecorator to Rails decorator

* Add specs to PodcastEpisodeDecorator and fix bugs

* Convert PodcastEpisodeDecorator to a Rails decorator

* Add missing specs for ArticleDecorator and fix bugs

* Convert ArticleDecorator to Rails decorator

* Add missing specs to UserDecorator and fix issues

* Convert UserDecorator to Rails decorator

* Add .decorate_collection method

* Add decorator for AR relations and remove Draper

* Rename BaseDecorator back to ApplicationDecorator

* Rename .decorate_ back to .decorate

* Restore decorate_collection (WTH)

* Add decorated?

* Fix bugs and failing specs

* Decoration should always be explicit
2020-02-17 09:32:32 -05:00
Alex
591ac771cc Move Webhook::DispatchEventJob to Sidekiq (#5722) [deploy] 2020-01-27 14:36:27 -05:00
serena
1297f1cb3e Replace Notifications::NotifiableActionJob with Notifications::NotifiableActionWorker for Sidekiq (#5588) [deploy] 2020-01-22 09:40:55 -05:00
Lucas Hiago
74f9decc56 Change Notifications::RemoveAllJob to Notifications::RemoveAllWorker and move to sidekiq (#5451) 2020-01-15 12:34:12 -05:00
Molly Struve
1a76fa03d7 Return ActionController::RoutingError error when Invalid Format is Requested (#5140) [deploy]
* Return ActiveRecord::RecordNotFound error when an invalid format is requested

* raise ActionController::RoutingError when template is not found
2019-12-17 10:00:12 -05:00