1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

a little more testing

هذا الالتزام موجود في:
Adam Cooke
2017-05-08 16:39:32 +01:00
الأصل 61e3bad83f
التزام eee01c9e15
10 ملفات معدلة مع 257 إضافات و4 حذوفات

عرض الملف

@@ -14,13 +14,30 @@ RSpec.configure do |config|
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
config.include FactoryGirl::Syntax::Methods
config.include Postal::RspecHelpers
config.before(:suite) do
# Test that the factories are working as they should and then clean up before getting started on
# the rest of the suite.
begin
DatabaseCleaner.start
FactoryGirl.lint(FactoryGirl.factories.select { |f| !FACTORIES_EXCLUDED_FROM_LINT.include?(f.name.to_sym) })
ensure
DatabaseCleaner.clean
end
# We're going to create a global server that can be used by any tests.
# Because the mail databases don't use any transactions, all data left in the
# database will be left there unless removed.
DatabaseCleaner.start
GLOBAL_SERVER = FactoryGirl.create(:server, :provision_database => true)
end
config.after(:suite) do
# Remove the global server after the suite has finished running and then
# clean the database in case it left anything lying around.
GLOBAL_SERVER.destroy
DatabaseCleaner.clean
end
end