rails/guides
Sander Verdonschot 315db730cc
Update job testing guidelines
The current example test for jobs using `perform_now` to run the job inline. This is problematic for jobs that have retries configured, as any exception that is retried will be silently rescued. Ideally, the test will still fail because the job did not perform the work it was supposed to, but it makes finding the root cause a lot harder.

Testing with `perform_enqueued_jobs` and `perform_later` gets around this problem, as the retries are also performed immediately and, assuming that the exception happens consistently, it will bubble up after exhausting its retries.

Therefore, this PR updates the basic test guidance to suggest `perform_enqueued_jobs` and `perform_later` over `perform_now`.

Both described behaviours make it harder to test that a job raises a specific exception, so this requires special handling, which I added a paragraph on. I can pull that out to a separate PR if desired.
2023-08-16 16:49:46 -04:00
..
assets Fixing fetch image on 'back-to-top' button 2023-06-01 09:53:39 -03:00
bug_report_templates Set secret_key_base on config in bug_report_templates 2023-06-18 18:58:22 +02:00
rails_guides Update guides generation to use Nokogiri's HTML5 parser 2023-06-19 15:38:13 -04:00
source Update job testing guidelines 2023-08-16 16:49:46 -04:00
.document adds guides/.document to tell rdoc not to process this directory 2013-03-04 22:28:23 +01:00
.rubocop.yml Add rubocop-md for linting guides snippets 2023-03-15 10:48:19 +09:00
CHANGELOG.md Adding the button using JS and styling with CSS and Image 2023-05-31 17:38:44 -03:00
Rakefile Merge pull request #47354 from etiennebarrie/deprecate-ActiveSupport-Deprecation-usage 2023-04-06 10:20:38 -04:00
rails_guides.rb Replaces mobi guide with epub for docs because of discontinued support 2022-08-05 00:18:20 +05:30
w3c_validator.rb Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00