⌚ OpenOpeningstijden main server application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_helper.rb 896B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # frozen_string_literal: true
  2. require 'minitest/autorun'
  3. require 'database_cleaner'
  4. require 'byebug'
  5. require 'hours'
  6. require 'app'
  7. require 'awesome_print'
  8. require 'ostruct'
  9. ENV['RACK_ENV'] = 'test'
  10. require_relative 'support/event_helpers.rb'
  11. require_relative 'support/file_helpers.rb'
  12. require_relative 'support/request_helpers.rb'
  13. require_relative 'support/time_helpers.rb'
  14. module Minitest
  15. class Spec
  16. include EventHelpers
  17. include FileHelpers
  18. include RequestHelpers
  19. include TimeHelpers
  20. EventSourcery.configure do |config|
  21. config.logger = Logger.new(nil)
  22. end
  23. before do
  24. DatabaseCleaner.strategy = :truncation
  25. DatabaseCleaner.clean
  26. end
  27. protected
  28. def fixtures(file)
  29. File.join(__dir__, 'fixtures', file)
  30. end
  31. def json_fixtures(file)
  32. JSON.parse(File.read(fixtures(file)), symbolize_names: true)
  33. end
  34. end
  35. end