All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
37 lines
631 B
Ruby
37 lines
631 B
Ruby
# frozen_string_literal: true
|
|
|
|
ENV['APP_ENV'] = 'test'
|
|
|
|
require_relative '../src/server'
|
|
require 'rspec'
|
|
require 'rack/test'
|
|
require 'database_cleaner/sequel'
|
|
|
|
# setting this here so all redirect tests can reference the same base URL
|
|
BASE_URL = 'http://example.org'
|
|
|
|
module RSpecMixin
|
|
|
|
include Rack::Test::Methods
|
|
|
|
def app
|
|
GameData
|
|
end
|
|
|
|
end
|
|
|
|
RSpec.configure do |config|
|
|
config.include(RSpecMixin)
|
|
|
|
config.before(:suite) do
|
|
DatabaseCleaner.strategy = :truncation
|
|
DatabaseCleaner.clean_with(:truncation)
|
|
end
|
|
|
|
config.around(:each) do |suite|
|
|
DatabaseCleaner.cleaning do
|
|
suite.run
|
|
end
|
|
end
|
|
end
|