docbrown/spec
Francisco Quintero 3b939f6b9f
[deploy] Add Reddit Liquid Tag (#8111)
* Implement Reddit liquid tag

* Set reddit content in locals

* Change Reddit liquid tag content layout

I decided a UI similar to the Stack Exchange tag would be better.

Now the Reddit tag looks a bit similar.

* Add tests for RedditTag

* Add reddit liquid tag example to docs

Also emphasize notice about compilation of article when using any
liquid tag

* Parse markdown text reddit content for RedditTag

* Display date RedditTag post was published

* Remove file location comments

* Change order of conditional for Reddit liquid tag

Sometimes the attribute `post_hint` might be null and neither condition
would apply.

* Add example to use Reddit liquid tag

* Change reddit svg icon for Reddit liquid tag

* handle and verify status of Reddit links

Here we make sure the passed link is a valid one in terms of URI composition (e.g. protocol)
but also that the URL is one that points to existing content in Reddit.

If the URL isn't returning anything but a successful response code (200) then
we treat it as an invalid one.

* Do not use VCR for RedditTag specs

The generated cassette for this tag was really huge (6000+ lines).

Using mocks (as in the MediumTag spec) still does the job and without
that huge VCR file.

* Remove index line from schema.db

* Improve RedditJsonFromUrlService

- Change User-Agent in requests to one read from app configuration
- Remove Reddit URL check by making a GET request
- Add regexp to validate URL looks like a Reddit URL

* Move RedditJsonFromUrlService methods to RedditTag

Also changed the way the request was being mocked. Previously, it was by
mocking the service class now I'm mocking HTTParty directly and returning
the JSON structure Reddit uses.
2020-06-01 18:52:07 -04:00
..
black_box Adjust type tags for RSpec (#4864) 2019-11-20 13:01:30 -05:00
decorators [deploy] Rename classified listings (#7910) 2020-05-27 13:35:09 +00:00
factories Leverage announcement broadcasts (#8150) [deploy] 2020-05-29 11:38:41 -07:00
fixtures [deploy] Decouple Twitter authentication from fetching tweets (#7920) 2020-05-19 18:05:41 -04:00
helpers Add feature flag support to Pages (#8149) 2020-06-01 09:23:19 -05:00
initializers [deploy] Add API Key to API Write Throttle (#8110) 2020-05-28 09:45:01 -05:00
labor [deploy] Rename classified listings (#7910) 2020-05-27 13:35:09 +00:00
lib Routine rubocop fixes (#8137) 2020-05-29 11:56:52 +02:00
liquid_tags [deploy] Add Reddit Liquid Tag (#8111) 2020-06-01 18:52:07 -04:00
mailers Update the tag moderation email (#8048) 2020-05-28 17:46:41 +02:00
models Leverage announcement broadcasts (#8150) [deploy] 2020-05-29 11:38:41 -07:00
policies Refactoring GitHub Repos functionality - step 1 (#7764) 2020-05-12 13:48:19 +02:00
queries/internal Limit the Number of API Keys a User Can Have (#7870) 2020-05-15 11:33:02 +02:00
requests Set Redis URL that will not be reused in specs (#8227) 2020-06-01 16:46:23 -05:00
routing Remove harcoded shop strings (#7319) 2020-04-16 14:51:23 +02:00
serializers/search Clear Elasticsearch Data Instead of Resetting Entire Index for Specs (#7602) 2020-04-30 11:59:10 -04:00
services [deploy] Fix badge count update after merge (#8210) 2020-06-01 14:01:46 -04:00
support Actually Replace File Name Colons (#8036) 2020-05-22 15:02:29 -05:00
system [deploy] Optimization:Use Scope and current_user to Get Notification Count (#8177) 2020-06-01 09:27:46 -05:00
tasks [deploy] Create FastlyConfig & refactor params safe list (#7630) 2020-05-01 11:23:48 -04:00
uploaders Some RSpec fixes (#6757) 2020-03-24 13:16:19 -04:00
views [deploy] Authentication refactoring: add available and enabled providers (#7505) 2020-04-28 16:16:28 +02:00
workers [deploy] Rename classified listings (#7910) 2020-05-27 13:35:09 +00:00
rails_helper.rb [deploy] Comment out Percy Code Failing Specs (#8077) 2020-05-27 10:12:28 -05:00
spec_helper.rb Update .simplecov (#8078) 2020-05-27 14:37:21 -04:00