update validation check: Rails 4 -> 5 changes validation message. It is enough to say that the validation has failed without checking for a specific error message. Especially if we did not customize the error message.
add version check to check correct worker is run after_commit. after_commit tests work differently from Rails 4 to Rails 5, do to commit callbacks not getting called in transactional tests in rails versions less than 5. (This bug gets fixed in Rails 5)
See: https://stackoverflow.com/a/30901628/15768801
Changes
update validation check: Rails 4 -> 5 changes validation message. It is enough to say that the validation has failed without checking for a specific error message. Especially if we did not customize the error message.
add version check to check correct worker is run after_commit. after_commit tests work differently from Rails 4 to Rails 5, do to commit callbacks not getting called in transactional tests in rails versions less than 5. (This bug gets fixed in Rails 5) See: https://stackoverflow.com/a/30901628/15768801