mirror of
https://github.com/Evolix/chexpire.git
synced 2024-05-23 10:48:50 +02:00
commit
78be2e938b
|
@ -39,4 +39,9 @@ class User < ApplicationRecord
|
||||||
validates :tos_accepted, acceptance: true
|
validates :tos_accepted, acceptance: true
|
||||||
|
|
||||||
scope :notifications_disabled, -> { where(notifications_enabled: false) }
|
scope :notifications_disabled, -> { where(notifications_enabled: false) }
|
||||||
|
|
||||||
|
# Devise ActiveJob integration
|
||||||
|
def send_devise_notification(notification, *args)
|
||||||
|
devise_mailer.send(notification, self, *args).deliver_later
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
require "null_logger"
|
require "null_logger"
|
||||||
require "whois/errors"
|
require "whois/errors"
|
||||||
require "whois/parser/afnic"
|
require "whois/parser/afnic"
|
||||||
|
require "whois/parser/pir"
|
||||||
require "whois/parser/verisign"
|
require "whois/parser/verisign"
|
||||||
|
|
||||||
module Whois
|
module Whois
|
||||||
module Parser
|
module Parser
|
||||||
PARSERS = [AFNIC, Verisign].freeze
|
PARSERS = [AFNIC, Verisign, PIR].freeze
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def for(domain, logger: NullLogger.new)
|
def for(domain, logger: NullLogger.new)
|
||||||
|
|
|
@ -12,5 +12,9 @@ development:
|
||||||
<<: *default
|
<<: *default
|
||||||
host: "chexpire.local"
|
host: "chexpire.local"
|
||||||
|
|
||||||
|
production:
|
||||||
|
action_mailer_config:
|
||||||
|
delivery_method: :sendmail
|
||||||
|
|
||||||
# test configuration included in file used by CI services
|
# test configuration included in file used by CI services
|
||||||
<%= IO.read Rails.root.join("config", "chexpire.test.yml") %>
|
<%= IO.read Rails.root.join("config", "chexpire.test.yml") %>
|
||||||
|
|
|
@ -44,6 +44,10 @@ Rails.application.configure do
|
||||||
|
|
||||||
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host"), port: 3000 }
|
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host"), port: 3000 }
|
||||||
|
|
||||||
|
config.chexpire.fetch("action_mailer_config", {}).each_pair do |key, value|
|
||||||
|
config.action_mailer[key] = value
|
||||||
|
end
|
||||||
|
|
||||||
# Print deprecation notices to the Rails logger.
|
# Print deprecation notices to the Rails logger.
|
||||||
config.active_support.deprecation = :log
|
config.active_support.deprecation = :log
|
||||||
|
|
||||||
|
|
|
@ -65,10 +65,12 @@ Rails.application.configure do
|
||||||
# Ignore bad email addresses and do not raise email delivery errors.
|
# Ignore bad email addresses and do not raise email delivery errors.
|
||||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||||
# config.action_mailer.raise_delivery_errors = false
|
# config.action_mailer.raise_delivery_errors = false
|
||||||
config.action_mailer.default_url_options = { host: 'chexpire.evolix.org' }
|
|
||||||
|
|
||||||
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host") }
|
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host") }
|
||||||
|
|
||||||
|
config.chexpire.fetch("action_mailer_config", {}).each_pair do |key, value|
|
||||||
|
config.action_mailer[key] = value
|
||||||
|
end
|
||||||
|
|
||||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||||
# the I18n.default_locale when a translation cannot be found).
|
# the I18n.default_locale when a translation cannot be found).
|
||||||
config.i18n.fallbacks = true
|
config.i18n.fallbacks = true
|
||||||
|
|
|
@ -67,6 +67,9 @@ Rails.application.configure do
|
||||||
# config.action_mailer.raise_delivery_errors = false
|
# config.action_mailer.raise_delivery_errors = false
|
||||||
|
|
||||||
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host") }
|
config.action_mailer.default_url_options = { host: config.chexpire.fetch("host") }
|
||||||
|
config.chexpire.fetch("action_mailer_config", {}).each_pair do |key, value|
|
||||||
|
config.action_mailer[key] = value
|
||||||
|
end
|
||||||
|
|
||||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||||
# the I18n.default_locale when a translation cannot be found).
|
# the I18n.default_locale when a translation cannot be found).
|
||||||
|
|
|
@ -17,7 +17,11 @@ class UsersTest < ApplicationSystemTestCase
|
||||||
fill_in("user[password_confirmation]", with: password)
|
fill_in("user[password_confirmation]", with: password)
|
||||||
check "user[tos_accepted]"
|
check "user[tos_accepted]"
|
||||||
|
|
||||||
click_button I18n.t("devise.registrations.new.sign_up")
|
# confirmation email is sent in async
|
||||||
|
perform_enqueued_jobs do
|
||||||
|
click_button I18n.t("devise.registrations.new.sign_up")
|
||||||
|
end
|
||||||
|
assert_performed_jobs 1
|
||||||
|
|
||||||
assert_equal root_path, page.current_path
|
assert_equal root_path, page.current_path
|
||||||
user = User.find_by!(email: email, confirmed_at: nil)
|
user = User.find_by!(email: email, confirmed_at: nil)
|
||||||
|
|
Loading…
Reference in a new issue