test: add tests for Server model

This commit is contained in:
Adam Cooke
2024-02-23 22:51:34 +00:00
committed by Adam Cooke
parent 8b61100082
commit 2023200d91
19 changed files with 707 additions and 64 deletions
+10
View File
@@ -9,6 +9,7 @@ require "factory_bot"
require "timecop"
require "database_cleaner"
require "webmock/rspec"
require "shoulda-matchers"
DatabaseCleaner.allow_remote_database_url = true
ActiveRecord::Base.logger = Logger.new("/dev/null")
@@ -16,8 +17,17 @@ ActiveRecord::Base.logger = Logger.new("/dev/null")
Dir[File.expand_path("factories/*.rb", __dir__)].each { |f| require f }
Dir[File.expand_path("helpers/**/*.rb", __dir__)].each { |f| require f }
ActionMailer::Base.delivery_method = :test
ActiveRecord::Migration.maintain_test_schema!
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end
RSpec.configure do |config|
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!