Making sure you are not creating unwanted actions by including Modules

This will blow up if someone includes a module with public methods that would count as actions.

# application_controller_test.rb
class ApplicationControllerTest < ActionController::TestCase
  class CleanController < ApplicationController
  end

  test "should be clean" do
    assert_equal [], CleanController.action_methods.to_a.
      reject{|a| a =~ /^_conditional_callback_around_/}
  end
end

Ruby/ActiveRecord fastest way to truncate test database

Tried a few strategies, but this seems to be the fastest:
DatabaseCleaner truncate_all: 0.8s
This: 0.2s

# fast truncation of all tables that need truncations (select is 10x faster then truncate)
# https://grosser.it/2012/07/03/rubyactiverecord-fastest-way-to-truncate-test-database/
def truncate_all_tables
  config = ActiveRecord::Base.configurations[::Rails.env]
  connection = ActiveRecord::Base.connection
  connection.disable_referential_integrity do
    connection.tables.each do |table_name|
      next if connection.select_value("SELECT count(*) FROM #{table_name}") == 0
      case config["adapter"]
      when "mysql", "mysql2", "postgresql"
        connection.execute("TRUNCATE #{table_name}")
      when "sqlite", "sqlite3"
        connection.execute("DELETE FROM #{table_name}")
        connection.execute("DELETE FROM sqlite_sequence where name='#{table_name}'")
      end
    end
    connection.execute("VACUUM") if config["adapter"] == "sqlite3"
  end
end