Why after_commit not running even with use_transactional_fixtures = false
问题 Transactional fixtures in rspec prevent after_commit from being called, but even when I disable them with RSpec.configure do |config| config.use_transactional_fixtures = false end The after_commit callback does not run. Here is a rails app with the latest rspec / rails that I have produced the issue on: git://github.com/sheabarton/after_commit_demo.git 回答1: One way around this is to trigger the commit callbacks manually. Example: describe SomeModel do subject { ... } context 'after_commit' do