mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
* Add setting fields to model * Allow to configure SMTP settings * Normalize locales * Cleanup locales * Remove 'coming soon' * fix test * Reset credentials * Reset development config * Check smtp spelling * Use post instead of get method * TLS ENV variable is more descriptive * Rework application mailer * Follow rails convention for mailer action params * Reset schema.rb to main * Test WIP * Add test for controller and mailer * Move tests from controller to model * Custom error message if settings are not all present * Comment smtp config in development env * Add default tls enabled value * Rubocop * Fix controller test * Reset credentials * Normalize locales * Test * fix test * Fix application mailer test that fails randomly * Error flash message instead of notice * Rework application mailer tests
23 lines
740 B
Ruby
23 lines
740 B
Ruby
require "test_helper"
|
|
|
|
class AccountTest < ActiveSupport::TestCase
|
|
test "#send_test_email return true if all smtp settings are populated" do
|
|
Setting.smtp_host = "smtp.example.com"
|
|
Setting.smtp_port = 466
|
|
Setting.smtp_username = "user@example.com"
|
|
Setting.smtp_password = "notification@example.com"
|
|
Setting.email_sender = "password"
|
|
|
|
assert Setting.smtp_settings_populated?
|
|
end
|
|
|
|
test "#send_test_email return false if one smtp settings is not populated" do
|
|
Setting.smtp_host = ""
|
|
Setting.smtp_port = 466
|
|
Setting.smtp_username = "user@example.com"
|
|
Setting.smtp_password = "notification@example.com"
|
|
Setting.email_sender = "password"
|
|
|
|
assert_not Setting.smtp_settings_populated?
|
|
end
|
|
end
|