Commit graph

17 commits

Author SHA1 Message Date
Anna Buianova
7d053471f8
Rubocop fixes in spec/requests (#18946)
* Rubocop fixes in spec/requests

* Fixed spec/requests/api/v0/articles_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-01-12 19:10:16 +03:00
Joshua Wehner
f97b5de96e
Remove social_preview views (except articles) (#18523)
* Remove social_preview views (except articles)

* Remove unreachable controller actions
2022-10-11 12:28:55 +02:00
Vaidehi Joshi
4e14350438
Remove SheCoded Specific Code (#13363)
Closes https://github.com/forem/forem/issues/13212.
2021-04-12 11:04:58 -07:00
rhymes
f1ec04a0c9
Rubocop: move dot in multi-line calls to leading position (#9262) 2020-07-16 15:51:11 +02:00
Michael Kohl
7f75f99560
[deploy] Rename classified listings (#7910)
* Change models and related files

* Update controllers and specs

* More renaming

* Seek and destroy, I mean search and replace

* Round up the stragglers

* Ground control to Major Travis...

* More fixes

* PR feedback

* Various fixes

* Rename view

* Fix list query builder

* Unify request specs

* Fix some API spec errors

* Fix remaining API specs

* Make spec conform to API

* Fix leftover problems

* Fix JS tests

* Fix column name in select

* Fix API specs

* Fix search specs

* Paging Mr. Travis
2020-05-27 13:35:09 +00:00
Michael Kohl
9df68f3920
Use new classified listing categories (#7250)
* Add ClassifiedListingCategoryModel

* Add data update script for classified listing categories

* Refactor and fix specs

* Resolve conflict

* Incorporate PR feedback
2020-04-23 10:06:58 +07:00
Ben Halpern
2a1a675175
Changed shecoded preview template (#6475)
* Changed shecoded preview template

* Added a test for social preview template with multiple campaign tags

* feat: update some css properties to make it closer to the design (i think)

* Update to relative units

* Update spec

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-03-05 18:26:28 -05:00
Anna Buianova
df93e8d41e
Custom social preview template for tags (#6290) [deploy]
* Custom social preview template for tags

* Added index on tags social_preview_template + small refactoring

* Add checks if index exists to tags migration
2020-02-27 17:56:21 -05:00
Anna Buianova
01456fe029 [deploy] Finalize deleting user associations (#5624)
* Prepare factories and associations for Users::DeleteActivity specs

* Altered user associations, delete the needed associations in Users::DeleteActivity

* Moved and refined user deletion spec

* Removed useless commented user associations

* Refactored BackupData factory

* Refactored ProfilePin factory

* Refactored Reaction factory

* Fixed specs: Keep default _type in factories or specify it in tests

* Ok, notes shouldn't be deleted on user deletion

* Fixed creating reactable for specs

* Specify commentable/commentable_type explicitly when creating data for tests

* Fixed typo in the comments spec

* Removed unnneeded space

* Added aggregate_failures for testing user associations deletion

* Keep feedback_messages while deleting user activities
2020-01-23 11:29:47 -05:00
Mike Coutermarsh
3128c17fab Improve twitter card caching (#5206) [deploy]
* update test so it fails from badge randomness

* Better caching

This removes the randomness from the views. Which means the cache keys
won't get regenerated every request.

The badges will still be in random positions, but it will change per
user/article rather than every render.
2019-12-23 12:22:38 -05:00
Regina Alyssa
8b4f7faf6b Comment Social Preview (#4260)
* Add route for comment social preview

* Add method comment to social_previews_controller

* Add view for comment social preview

* Fix spacing in meta keywords

* Update comments page keywords

* Create helper for comment social media image

* Use comment social image, add published condition for article social image

* Add tests for comment social preview

* Remove not_found fallback for social previews controller

* Remove cached_tag_list

* Update typos of word 'image' in spec
2019-10-07 10:03:03 -04:00
Mike Coutermarsh
8afb797ec9 Improve social card caching 🚀 (#3265)
* Add failing tests for social previews controller. HTML changes between
requests, which breaks caching.

Since we use the HTML to generate the cache key. When the views have any
randomness in them, it breaks the cache, which means we regenerate
images on each request, rather than using what's in memcached.

Adding test to protect from regressions

* Fix randomness in social card templates

The aria tags are randomly generated. Since this is for rendering
images, they aren't needed.

* Make the linter happy by using the sanitize helper
2019-06-25 08:45:30 -04:00
Jess Lee
10674aed72 Buffer Listings (#2956)
* add share to buffer button

* wip

* wip

* adds listings to buffer via form

* create migration for buffered timestamp and update seed file

* display when listing was last buffered

* remove annoying spacing

* refactor article script for listings

* social preview wip

* add custom social card for indivdual listings

* add styling

* fix css

* tweak styling

* final css tweaks

* fix branch

* add buffer listings id

* update envfile

* add social previews spec
2019-06-14 19:33:19 -04:00
Mac Siri
73127aca01 Remove controller specs (#2224)
* Create more request specs

* Update wording

* Update guard to work with requests

* Fix broken spec

* Remove rails-controller-testing gem

* Move article_specs

* Move last controller spec out

* Remove controller spec config

* Fix broken spec

* Remove all use of render_template

* Refactor spec

* Tweak User#remember_me

* Create ArticleAnalyticFetcher spec

* Undo User#remember_me

* Use srand in rspec

* Create FeedbackMessagesHelper spec

* Add DigestMailer spec

* Fix broken test
2019-03-29 19:05:02 -04:00
Mike Coutermarsh
dd84051ce4 Social Card upgrade - Part 1 (#2090)
* Add HtmlCssToImage for generating images

This will be used by social_previews to convert the templates into images.

Setup a fallback image primarily for local dev, so that this won't cause
errors if authentication is missing.

Caching is setup to use contents of the html/css. So it with
autobust/generate a new image whenever the markup changes.

* Update Article social preview template to not be random

+ Being random breaks caching (since we generate cachekey by a SHA of html content)
+ Use Roboto for when generating via HTML/CSS to Image

* Update Tag social preview template to not be random

+ Make rand deterministic so it doesn't break caching

* Update user social preview template for html/csstoimage

* Update shecoded template to work with both url2png and htmlcsstoimage

* Add ability to respond to .png for social previews controller

When adding .png to the url, these routes will now generate an image and
redirect to it.

This leaves the existing pages as they were, so we're backwards
compatible with all the existing links out in the world.

* Fix merge conflicts

* Remove some duplication

* Improve spec descriptions/read better

* clean up setting template with a ternary
2019-03-22 16:28:02 -04:00
rhymes
e588fa7ece Code cleanups (#659)
* Initial automatic cleanup with rubocop

* Fix syntax error introduced by rubocop

* Cleanup seeds file

* Cleanup lib folder

* Exclude bin folder because it contains auto generated files

* Make Rubocop a little bit more chatty

* Block length should not include comments in the count

* Cleanup config folder

* Cleanup specs

* Updated Rubocop version and generated a todo file

* Fix broken ArticlesApi spec

* Fix tests

* Restored rubocop pre-commit hook
2018-08-07 11:00:13 -04:00
Ben Halpern
0755a07713
Add misc specs and remove banned attribute from user model (#484) 2018-06-22 16:06:04 -04:00