Commit graph

3365 commits

Author SHA1 Message Date
Ben Halpern
eaf6ea2f4b
Update pageviews count less often in page_views_controller (#4945) [deploy] 2019-11-26 14:11:47 -05:00
Molly Struve
3be406290a
Store FollowChecker responses to Avoid Multiple db Hits (#4886) [deploy] 2019-11-26 13:03:19 -06:00
rhymes
0ffa127481 Refactor session_current_user_id in a shared concern (#4936) 2019-11-26 13:21:56 -05:00
rhymes
c08e5f0a25 Remove rubyzip initializer (#4935) [deploy]
No longer necessary on Rubyzip 2
2019-11-26 11:25:16 -05:00
rhymes
87116dcc56 Increase efficiency in models/article_spec.rb (#4882) [deploy]
* Add test sampler

* Use let! and let_it_be for article_spec.rb

* Regroup and restructure expectations and tests

* Move private methods in private

* Decrease the needed objects in .seo_boostable test

* Re-use the user

* Newlined
2019-11-26 10:32:39 -05:00
Anthony Musyoki
2537670968 Refactor raise_error(specific_error) expectation (#4912)
* Refactor raise_error(specific_error) expectation

The full RSpec warining is
```
WARNING: Using `expect { }.not_to raise_error(SpecificErrorClass)` risks false positives,
since literally any other error would cause the expectation to pass,
including those raised by Ruby (e.g. NoMethodError, NameError and ArgumentError),
meaning the code you are intending to test may not even get reached.
Instead consider using `expect { }.not_to raise_error` or `expect { }.to raise_error(DifferentSpecificErrorClass)`.
```

* Refactor jsitor tests to test behaviour

As pointed out by @rhymes, the previous tests were not
testing actual behaviour. This is an attempt at improving the tests.
2019-11-26 08:46:33 -05:00
Jacob Herrington
7d0aeeefe5 Improve the clarity of the docs and fix Prettier config (#4899)
* Improve format and clarity of the docs [ci skip]

While this change produces a lot of git noise by enacting what seems
like an arbitrary linewrap on most of the files in the documentation it
will result in better version control and tracking of the changes in the
documentation.

For example, as it currently stands, if one was to make a
PR to move a comma in a sentence because each paragraph in most of the
files is on a single line, that small change would look in the git
history like the author had modified the entire paragraph. In reality,
this author just moved a comma.

This change also includes a significant number of modifications to the
more article-esque docs. Many of these docs were written in a sort of
stream-of-conciousness and aren't as easy to read as they could be.
Hopefully this is the first of several readability changes. If we could
get these docs to a more accessible reading level, we would probably see
an increase in contributions. :)

* Delegate markdown wrapping to Prettier

* Add linewrapping explanation in the docs [ci skip]
2019-11-26 08:40:53 -05:00
Ben Halpern
4dabe265c6
Fix linting (#4933) [deploy] 2019-11-26 08:35:34 -05:00
Ben Halpern
481871f127
Revert Redis fragment cache (#4932) [deploy] 2019-11-25 19:33:30 -05:00
Ben Halpern
befefd08d0
Remove extra dependencies for PageViewsController (#4923) [deploy]
* Remove extra dependencies for PageViewsController

* Fix strongparams and fix typo

* Fix spec

* Remove unnecessary page_view param

* Remove additional unnecessary page_view

* Create ApplicationMetalController for shared Metal behavior

* Revert rand numbers to ensure apples-to-apples perf compare

* Whoops, revert change revert

* Clarify comment
2019-11-25 19:06:34 -05:00
Molly Struve
e5d438efb0 Move organization profile image cache to Redis (#4930) [deploy] 2019-11-25 18:19:04 -05:00
Molly Struve
59e9971d06 move bottom_content article content to Redis (#4927) 2019-11-25 18:17:19 -05:00
Molly Struve
441c216e66 remove article-main-reactions cache key (#4928) 2019-11-25 18:16:43 -05:00
dependabot-preview[bot]
0b9ccaad06 Bump rubyzip from 1.3.0 to 2.0.0 (#4915) 2019-11-25 17:03:22 -05:00
Callum Williams
337e66fdd7 Fix light outline around sidebar profile picture in night mode (#4799)
Use theme-container-background over $tan for sidebar profile picture background. This prevents ugly rendering with the night theme in Firefox.
2019-11-25 15:18:38 -05:00
dependabot-preview[bot]
ee860857c1 Bump twilio-ruby from 5.29.0 to 5.29.1 (#4919) [deploy] 2019-11-25 15:06:30 -05:00
dependabot-preview[bot]
bc956a1681 Bump inline_svg from 1.5.2 to 1.6.0 (#4917) 2019-11-25 15:04:17 -05:00
dependabot-preview[bot]
c14c02d440 Bump rouge from 3.12.0 to 3.13.0 (#4914) 2019-11-25 15:03:22 -05:00
dependabot-preview[bot]
41def72da7 Bump pusher-js from 5.0.2 to 5.0.3 (#4909) [deploy] 2019-11-25 14:14:55 -05:00
dependabot-preview[bot]
d4969b3dbe Bump aws-sdk-lambda from 1.31.0 to 1.32.0 (#4916) 2019-11-25 14:14:17 -05:00
rhymes
213e7bebab Routine rubocop fixes (#4924)
Ran rubocop -a and rubocop --auto-gen-config
2019-11-25 14:13:22 -05:00
dependabot-preview[bot]
4760a6de9f Bump rubocop-rspec from 1.36.0 to 1.37.0 (#4918) 2019-11-25 10:44:39 -05:00
dependabot-preview[bot]
cf403aba6c Bump eslint-config-prettier from 6.6.0 to 6.7.0 (#4908) 2019-11-25 10:43:34 -05:00
dependabot-preview[bot]
34991f405b Bump rspec-retry from 0.6.1 to 0.6.2 (#4913) 2019-11-25 10:42:49 -05:00
Molly Struve
477bc00676
Update reading list updated_at cache key timestamp (#4885) [deploy] 2019-11-25 09:28:29 -06:00
Jacob Herrington
d2112adcbf Delete a commented out system spec (#4905)
This test was commented out, but I don't see much information in the
commit message as to why. The Pull Request which this commit was merged
from seems to be lost as well.

This test does seem to pass when it's not commented out, but there must
have been a reason it was commented out.

That being said, the test isn't really *testing* much functionality.
Essentially, it just asserts that a page with the word "settings" on it
renders from several different approaches. This might be problematic
because a false positive would be quite easy.

In light of those things, it makes sense to me that this test should be
removed.
2019-11-25 08:20:13 -05:00
Takuma
18df55284e fix typo (#4896) 2019-11-25 08:16:35 -05:00
Jacob Herrington
5624b2e7f9 Add a link for Twitter developer access [ci skip] (#4891) 2019-11-25 08:16:16 -05:00
rhymes
71b25f9bc7 Enable AES-256-GCM on encrypted messages (#4826) [deploy] 2019-11-22 16:54:28 -05:00
Molly Struve
091392cf1f Remove webpush gem and code (#4883) 2019-11-22 16:46:11 -05:00
Ben Halpern
36479f09c3
Replace current_user.id with session_current_user_id (#4880) [deploy]
* Replace current_user.id with efficient_current_user_id in high-leverage areas

* Update name of efficient_current_user_id

* Replace user_signed_in? in pageviews

* Remove unneeded ?
2019-11-22 14:27:43 -05:00
Jacob Herrington
e79ad764bd Onboarding test love (#4878)
* Reduce code duplication in onboarding tests

* Update variable names for consistency

* Improve test descriptions and format

* Refactor a useless test

This test was fairly pointless, but hopefully with this refactor it
could detect a regression? Although, I think it's really just testing
the that the Preact framework's state mechanism is working the way we
expect it to, but it might be worth leaving this test in.
2019-11-22 14:23:57 -05:00
Molly Struve
61753715f1
Remove Service Worker Desktop Notification Code (#4881) [deploy] 2019-11-22 12:47:14 -06:00
rhymes
c9a07faf6a Add script to display and migrate environment variables to SiteConfig (#4865) [deploy] 2019-11-22 10:18:22 -05:00
leewynne
5b50d52b5f Replaced hard coded AWS region in carrierwave.rb and sitemaps.rb. Updated legacy migration files to include pre rails 5 version (this resolved new instances on Heroku) (#4874) [deploy]
* missing rails version 4.2 added to pre 5 migrations

* updated carrierwave.rb and sitemap.rb with AWS_DEFAULT_REGION
2019-11-22 09:07:59 -05:00
Ben Halpern
c817ac0192
Fix missing series in article edit form (v2) (#4867) [deploy] 2019-11-22 08:33:55 -05:00
Jacob Herrington
c6c5421163 Javascript automated testing and a11y doc (#4873)
* Add jext-axe package and introduce a11y testing

Automated a11y testing is NOT comprehensive. We cannot expect this to
even scratch the surface of potential a11y issues.

However, we can expect to find a percentage of issues that are currently
flying under the radar. Adopting some automation around a11y testing
also allows us to use CI to find a11y regressions -- which should be
really handy.

I've never really used Jest before, and Preact seems to make it a little
more complicated, but as far as I can tell, this is a decent way to add
at least some minor automated a11y testing.

* Add doc about automated a11y tests
2019-11-22 08:32:01 -05:00
Spencer
e5ee2f9013 Mod tooling: add tags via /mod (#4750) [deploy]
* added tests to specs

* added view logic

* added controller/model functionality

* minor tweak to tagadjustment view

* adjusted mod view to reduce query

* added instance variables to controller

* show already adjusted tags in mod view

* removed unnecessary ifs from mods controller

* catch and display errors to tag adjustment forms

* update specs and refactor
2019-11-21 16:32:32 -05:00
Jacob Herrington
10426fbef5 Delete a commented out test (#4875) 2019-11-21 15:14:12 -05:00
dependabot-preview[bot]
5d688fc0a6 Bump acts-as-taggable-on from 6.0.0 to 6.5.0 (#4854) 2019-11-21 14:56:28 -05:00
shaneblackburn
9d7817b025 Disable like button b/w click & backend response (#4869) [deploy] 2019-11-21 12:31:40 -06:00
rhymes
c8903876c6 Upgrade docs Ruby version to 2.6.5, same as the main app (#4872) 2019-11-21 08:16:13 -05:00
John Curcio
157a6f1ef1 Add pagination to followers and following page in dashboard (#258) (#4375) [deploy]
* Add infinite scroll to followers list (#258)

* Refactor fetchNext function for clarity (#258)

* Sepparate following tab into multiple tabs to support infinite scroll (#258)

* Add infinite scroll to following pages (#258)

* Add tests to infinite scroll api

* Refactor dashboard loading text

* Refactor infine scroll function

* Fix duplicated entries problem in infinite scrolling

* Switch randomized attributes to sequential to avoid InvalidRecord error

* Add acceptance tests for infinite scroll

* Remove unused following method

* parameterize limit per page for followers and followings

* Split follows endpoint into followers and followings

* Authenticate user with api key in followers and followings

* Split followers endpoint into users and organizations

* Add redundant html to sublist partial

* Speed up infinite scroll tests

* Refactor api json responses to use partials

* Authenticate api user before follows create

* Resolve conflicts on scrolling js

* Improve partials organization and fix organization username bug

* Improve readability of unauthorized test

* Use let! to create scrolling test data

* Fix not working podcasts link

* Refactor initScrolling to remove linting errors

* Fix codeclimate coding style issue

* Test tags forms and podcasts hyperlinks

* Fix eslint issue with double equals

* Improve before_action usage and readability
2019-11-20 18:21:18 -05:00
Bolarinwa Balogun
4536d35716 Fix broken layout from "additional config/settings" overlap (#4858) [deploy]
* Fix broken layout from "additional config/settings" overlap

* Resolve bugs by adding important state fields
2019-11-20 14:34:30 -05:00
Helmi Hidzir
4e4762e3a1 Add - to support dash character in JSitor liquid tag (#4830) [deploy]
* Add - to support dash character in JSitor liquid tag

* Edit spec/liquid_tags/jsitor_tag_spec.rb

* Add support for link with hyphen id in jsitor liquid tag
2019-11-20 13:36:51 -05:00
rhymes
0ef4ce4250 Adjust type tags for RSpec (#4864) 2019-11-20 13:01:30 -05:00
Mac Siri
d2373b5678
Add Clipboard polyfill (#4824) [deploy] 2019-11-20 11:32:30 -05:00
rhymes
b0eec90b24 Add additional keys to site configuration (#4861) [deploy]
* Add rate_limit_follow_count_daily to SiteConfig

* Add favicon_url to SiteConfig

* Add logo_svg to SiteConfig

* Add staff_user_id to SiteConfig

* Add default_site_email to SiteConfig

* Add social_networks_handle to SiteConfig

* Add ga_view_id and ga_fetch_rate to SiteConfig

* Add mailchimp newsletters IDs to SiteConfig

* Add periodic_email_digest_max, periodic_email_digest_min to SiteConfig
2019-11-20 10:58:10 -05:00
Nico Domino
8140ab6330 Updated 'ten-x-hacker' var --theme-anchor-color (#4836) 2019-11-19 10:58:20 -05:00
rhymes
c15d48265a Routine rubocop fixes (#4859) 2019-11-19 10:46:47 -05:00