refactor integration tests using ActiveRecord