class BaseTest
Constants
- TempAssetMailer
Public Instance Methods
setup()
click to toggle source
# File actioncable/test/server/base_test.rb, line 8 def setup @server = ActionCable::Server::Base.new @server.config.cable = { adapter: "async" }.with_indifferent_access end
welcome()
click to toggle source
# File actionmailer/test/base_test.rb, line 794 def welcome mail end
Private Instance Methods
mail_side_effects() { || ... }
click to toggle source
A
simple hack to restore the observers and interceptors for Mail, as it does not have an unregister API yet.
# File actionmailer/test/base_test.rb, line 885 def mail_side_effects old_observers = Mail.class_variable_get(:@@delivery_notification_observers) old_delivery_interceptors = Mail.class_variable_get(:@@delivery_interceptors) yield ensure Mail.class_variable_set(:@@delivery_notification_observers, old_observers) Mail.class_variable_set(:@@delivery_interceptors, old_delivery_interceptors) end
swap(klass, new_values) { || ... }
click to toggle source
Execute the block setting the given values and restoring old values after the block is executed.
# File actionmailer/test/base_test.rb, line 862 def swap(klass, new_values) old_values = {} new_values.each do |key, value| old_values[key] = klass.send key klass.send :"#{key}=", value end yield ensure old_values.each do |key, value| klass.send :"#{key}=", value end end
with_default(klass, new_values) { || ... }
click to toggle source
# File actionmailer/test/base_test.rb, line 875 def with_default(klass, new_values) old = klass.default_params klass.default(new_values) yield ensure klass.default_params = old end
with_translation(locale, data) { || ... }
click to toggle source
# File actionmailer/test/base_test.rb, line 894 def with_translation(locale, data) I18n.backend.store_translations(locale, data) yield ensure I18n.backend.reload! end