mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 10:56:22 +00:00
cad881db1c
habia un monton de inconsistencias que hacian que los posts se guardaran en cualquier lado, que empezaron a saltar apenas introdujimos la gestión de licencias
25 lines
695 B
Ruby
25 lines
695 B
Ruby
# frozen_string_literal: true
|
|
|
|
require File.expand_path('../config/environment', __dir__)
|
|
require 'rails/test_help'
|
|
require 'open3'
|
|
require 'sucker_punch/testing/inline'
|
|
|
|
Rails.application.load_seed
|
|
|
|
# rubocop:disable Style/ClassAndModuleChildren
|
|
class ActiveSupport::TestCase
|
|
include FactoryBot::Syntax::Methods
|
|
# Resetear el repositorio a su estado original antes de leerlo
|
|
#
|
|
# TODO mover a Site.reset! cuando empecemos a trabajar con git
|
|
def reset_git_repo(path)
|
|
Dir.chdir(path) do
|
|
Open3.popen3('git reset --hard') do |_, _, _, thread|
|
|
# Wait for the process to finish
|
|
thread.value
|
|
end
|
|
end
|
|
end
|
|
end
|
|
# rubocop:enable Style/ClassAndModuleChildren
|