Commit graph

21 commits

Author SHA1 Message Date
Molly Struve
10788a5016
Flaky Spec Fix:Clear Elasticsearch FeedContent to avoid trying to load missing images (#9402) 2020-07-20 09:01:42 -05:00
rhymes
5b62811c98
[deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
Vaidehi Joshi
d2ef01ecc2
Remove Percy (#8915)
We are no longer using the Percy service, so this code is not required anymore.
Removes the percy agent, the gem, and all references to Percy.snapshot and percy: true.
2020-06-25 11:19:58 -07:00
Molly Struve
232c67dd0a
Spec Speedup: Comment Out More Percy Only Specs (#8348) 2020-06-08 12:53:16 -05:00
Ben Halpern
3c840610a1
[deploy] Remove unnecessary bulk from image assets (#8306)
* Remove unnecessary bulk from image assets

* Swap background-image

* Fix test

* Fix test
2020-06-05 17:51:06 -04:00
Vaidehi Joshi
b1de4cb1cf
Add Percy 🦔 (#7783) [deploy]
* Add Percy to Gemfile, rails helper

* Percy snapshots for using the editor

* Add PERCY_TOKEN to sample_application.yml

* Percy snapshots for visiting the homepage

* Percy snapshots for viewing an article's comments

* Percy snapshots for creating an article

* Percy snapshots for editing an article

* Percy snapshots for logged in/out user

* Remove empty spec file

* Percy snapshots for settings page

* Percy snapshots for reading list

* Percy snapshots for admin view

* Percy snapshots for moderator view

* Percy snapshots for authentication views

* Percy snapshots for article and tag views

* Percy snapshots for editing/deleting comment views

* Percy snapshots for admin views

* Percy snapshots for comment views

* Percy snapshots for organization views

* Percy snapshots for pro membership views

* Percy snapshots for podcast views

* Percy snapshots for user views

* Percy snapshots for dashboard views

* Percy snapshots for homepage views

* Percy snapshots for video views

* Add js: true in tests that require it for Percy

* Percy dependency cleanup

* Add the Percy agent
* Remove the PERCY_TOKEN from sample_application.yml
* Move the Percy gem into the "test" group in the Gemfile

* Remove duplicate snapshots, provide unique names to snapshots

* Set seed on Faker::Config for deterministic Percy snapshots

* Freeze time in js: true tests for determinstic snapshots

* Upgrade Percy to v0.26.3

* Add percy: true flag for Percy snapshotting tests

* Add more percy: true flags
2020-05-18 11:35:53 -07:00
Dmitry Maksyoma
f63c7f9289
Fix Runkit tags not being activated when comment is added (#6767)
* Fix Runkit tags not being activated when comment is added

* Runkit tag activation was ran once, on page load. I've changed it to
  run on on comment preview and submit.
* It was necessary to add a check to skip already activated Runkit
  tags. The code didn't take into account that a tag could be already
  processed, and would just crash.

* Fix Runkit tags and add tests

* Add test for previewing article with Runkit tag

* "Fix CodeClimate not finding waitForRunkitAndActivateTags()

* Refactor a test for readability

* Make Rubocop happy

* Improve test for previewing article with Runkit tag

* Use one method for determining active Runkit tags

* Defer loading of JS from embed.runkit.com

* Add utility function dynamicallyLoadScript(url)

* Switch to dynamic loading of Runkit

* parsed content code block is also hidden now to avoid displaying <code /> block before runkit iframe loads.

* Fix Runkit test

* Remove Runkit script caching in v2 form

* Use <%== instead of .html_safe in v2 form

* Update app/assets/javascripts/utilities/dynamicallyLoadScript.js

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
2020-05-15 14:27:46 +02:00
rhymes
b5ebf8f3dc
Routine rubocop fixes (#7743)
* Rubocop auto fixes

* Fix Capybara/VisibilityMatcher

* Regenerate todo
2020-05-08 19:38:06 +02:00
Molly Struve
8eb4612166
[deploy] fix podcast episode comment rendering and write a spec for it (#7547) 2020-04-27 14:56:03 -05:00
Alex
efc08d9b74
[deploy] Add valiation for file name length to file uploads (#6918) 2020-03-27 18:54:27 -04:00
Alex
bc8c126497
Validate file uploads client-side (#6737)
* JavaScript MVP

- First round of linting
- Use for testing

* Add some default UI error handling

* Add file validation to updating profile image

* Add type validation and fix size bug

* Refactor and add file validation to article cover

* Add file validation to body images

* Add accept field to profile image form

* Add parseInt to maxFileSizeMb

* Add accept and max-file-size-mb to article images

* Change parseInt to Number

* Add file validations to podcast form

* Add accept image to podcasts

* Add file validation and accept field to org form

* Use appendChild for error message

* Add file validation to comment form

* Add JS Docs comments

* Remove redundant format check

* Add documentation to override default values

* Update documention (spelling, formatting, etc.)

* Update max-file-size-mb to 25

* Bump default max file size for images to 25

* Change appendChild to append

* Refactor remove error message

* Refactor JS, remove console logs, update error msg

* Remove video from permitted file types

* Update error messaging

* Update docs for funciton params...oops 🙈

* Fix file size check logic

- Allow for 0 maxFileSizeMb
- Use JSON.parse() for permittedFileTypes to get an Array

* Add specs

* Change blackbox to black box

* Remove wait_for_javascript

* Remove comments from spec
2020-03-24 09:21:49 +01: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
Molly Struve
29efdaf20a
Remove Comments::CreateIdCodeJob which is now done inline (#5536) 2020-01-16 09:31:11 -05:00
rhymes
fec196ffe3 Add wait_for_javascript to flaky system tests (#5405) 2020-01-08 13:47:08 -05:00
Molly Struve
b1a71d0ac1 Ensure comment has a path when created for specs (#5197) 2019-12-20 17:23:59 -05:00
Ben Halpern
630c1b7425
Migrate to streaming app shell via serviceworkers (#5020) [deploy]
* Initial work for streaming app shell way of using serviceworkers

* Close in on serviceworker adjustment finalization

* Add docs and loading indicator

* Remove useless code

* Don't run on API

* Update app/javascript/contentDisplayPolicy/hideBlockedContent.js

* Fix small details

* Don't run serviceworker.js code in test env

* Fix JS in serviceworker

* Move private keyword to proper place in async controller

* Change shell_version to HEROKU_SLUG_COMMIT

* Update caching config

* Add test for async_info/shell_version
2019-12-16 12:21:33 -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
rhymes
4e591fea1c Show localized date/time on hover for articles/comments (#2722)
* Add article decorator published_timestamp

* Use time HTML5 element and refactor date in partial

* Add published_timestamp to Article

Adding `published_timestamp` to the homepage we can then use JS to render the full timestamp localized for the user.

We've also added the timestamp to the index and the API

* Display article published timestamp on hover

* Use time also in the article show page

* Add timestamp to bottom articles as well

* Remove published_timestamp from index because it is not used

* Fix broken specs

* Add more article dates specs

* Refactor date initializers
2019-05-09 11:05:17 -04:00
rhymes
7d3fb0c0b5 Enable random order for specs (#2466) [ci skip] 2019-04-17 11:30:23 -04:00
Abraham Williams
b98565a931 Update rubocop to 0.67 (#2313) [ci skip] 2019-04-05 12:55:13 -04:00
Mac Siri
fc39f24ee3 Migrate feature test to system test (#2301)
* Move all features to system

* Remove database_cleaner & apply use_transactional_fixtures

* Move rspec-retry to :test

* Update Capybara config

* Update rails_helper

* Fix user_visits_a_comments_page_spec.rb

* Fix lint
2019-04-04 12:15:10 -04:00