OpenProject is the leading open source project management software.
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.
 
 
 
 
 
 
openproject/spec/support/shared/with_mail.rb

18 lines
420 B

RSpec.configure do |config|
config.around(:each) do |example|
config = example.metadata[:with_mail]
if example.metadata.key?(:with_mail) && !config
value = ActionMailer::Base.perform_deliveries
begin
ActionMailer::Base.perform_deliveries = false
example.run
ensure
ActionMailer::Base.perform_deliveries = value
end
else
example.run
end
end
end