Skip to content

Commit

Permalink
Silence callback deprecation warning if testing AJ
Browse files Browse the repository at this point in the history
Currently the log returned by running ActiveJob tests is filled with:

> DEPRECATION WARNING: Returning `false` in a callback will not implicitly halt a callback chain in the next release of Rails. To explicitly halt a callback chain, please use `throw :abort` instead.

For instance, see https://travis-ci.org/rails/rails/builds/77978273

This happens because some setup and teardown methods [like these one](https://github.com/rails/rails/blob/master/activejob/test/cases/async_job_test.rb#L10-L17)
invoke other methods like `perform_asynchronously!` that can return `false`, but
not with the intention of halting the process if they do.

In my opinion, these deprecation warnings can be silenced to have
the log result cleaner (especially when browsing for errors).
  • Loading branch information
claudiob committed Aug 31, 2015
1 parent 13c6903 commit 5e9a3e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions activejob/test/helper.rb
Expand Up @@ -3,6 +3,7 @@
require 'active_job'
require 'support/job_buffer'

ActiveSupport.halt_callback_chains_on_return_false = false
GlobalID.app = 'aj'

@adapter = ENV['AJ_ADAPTER'] || 'inline'
Expand Down

0 comments on commit 5e9a3e1

Please sign in to comment.