こしごぇ(B)

旧:http://d.hatena.ne.jp/koshigoeb/

Rails 4でRSpecしたらデータベースがロールバックされなくなった件

急に発症して大分悩んだわけですが、どうやらフィクスチャの teardown 処理のあたりに変化があった模様。

以下、Rails 4 のコードから抜粋。

module ActiveRecord
  module TestFixtures
    extend ActiveSupport::Concern

    def before_setup
      setup_fixtures
      super
    end

    def after_teardown
      super
      teardown_fixtures
    end

    included do

以下、Rails 3.2.13 のコードから抜粋。

module ActiveRecord
  module TestFixtures
    extend ActiveSupport::Concern

    included do
      setup :setup_fixtures
      teardown :teardown_fixtures

とりあえず、RSpec を github の master ブランチに切り替えたら解決した模様。