diff options
author | George Claghorn <george.claghorn@gmail.com> | 2019-01-04 16:17:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-04 16:17:51 -0500 |
commit | 8a23a0e8c20c0cccf0073906d7dd7f809bfa836d (patch) | |
tree | ff440700578822d1505feae8155a392272395030 /railties | |
parent | 188ce3567f16ee751c7a59ed3fe3ce6cf09a1658 (diff) | |
parent | 1d53654a9829dea823e0d1e8144d83f88cb2e3a7 (diff) | |
download | rails-8a23a0e8c20c0cccf0073906d7dd7f809bfa836d.tar.gz rails-8a23a0e8c20c0cccf0073906d7dd7f809bfa836d.tar.bz2 rails-8a23a0e8c20c0cccf0073906d7dd7f809bfa836d.zip |
Merge pull request #34867 from bogdanvlviv/test-actionmailbox-configurations
Test Action Mailbox configurations
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/configuration_test.rb | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 40ebe2fe0e..149f0e5af1 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -2254,6 +2254,77 @@ module ApplicationTests assert_nil ActiveStorage.queues[:purge] end + test "ActionMailbox.logger is Rails.logger by default" do + app "development" + + assert_equal Rails.logger, ActionMailbox.logger + end + + test "ActionMailbox.logger can be configured" do + app_file "lib/my_logger.rb", <<-RUBY + require "logger" + class MyLogger < ::Logger + end + RUBY + + add_to_config <<-RUBY + require "my_logger" + config.action_mailbox.logger = MyLogger.new(STDOUT) + RUBY + + app "development" + + assert_equal "MyLogger", ActionMailbox.logger.class.name + end + + test "ActionMailbox.incinerate_after is 30.days by default" do + app "development" + + assert_equal 30.days, ActionMailbox.incinerate_after + end + + test "ActionMailbox.incinerate_after can be configured" do + add_to_config <<-RUBY + config.action_mailbox.incinerate_after = 14.days + RUBY + + app "development" + + assert_equal 14.days, ActionMailbox.incinerate_after + end + + test "ActionMailbox.queues[:incineration] is :action_mailbox_incineration by default" do + app "development" + + assert_equal :action_mailbox_incineration, ActionMailbox.queues[:incineration] + end + + test "ActionMailbox.queues[:incineration] can be configured" do + add_to_config <<-RUBY + config.action_mailbox.queues.incineration = :another_queue + RUBY + + app "development" + + assert_equal :another_queue, ActionMailbox.queues[:incineration] + end + + test "ActionMailbox.queues[:routing] is :action_mailbox_routing by default" do + app "development" + + assert_equal :action_mailbox_routing, ActionMailbox.queues[:routing] + end + + test "ActionMailbox.queues[:routing] can be configured" do + add_to_config <<-RUBY + config.action_mailbox.queues.routing = :another_queue + RUBY + + app "development" + + assert_equal :another_queue, ActionMailbox.queues[:routing] + end + test "ActiveRecord::Base.filter_attributes should equal to filter_parameters" do app_file "config/initializers/filter_parameters_logging.rb", <<-RUBY Rails.application.config.filter_parameters += [ :password, :credit_card_number ] |