21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-05-04 17:55:11 +02:00

Merge pull request #18 from Evolix/hotfix

last production fixes
This commit is contained in:
Colin Darie 2018-06-05 20:35:58 +02:00 committed by GitHub
commit 78be2e938b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 4 deletions

View file

@ -39,4 +39,9 @@ class User < ApplicationRecord
validates :tos_accepted, acceptance: true
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

View file

@ -1,11 +1,12 @@
require "null_logger"
require "whois/errors"
require "whois/parser/afnic"
require "whois/parser/pir"
require "whois/parser/verisign"
module Whois
module Parser
PARSERS = [AFNIC, Verisign].freeze
PARSERS = [AFNIC, Verisign, PIR].freeze
class << self
def for(domain, logger: NullLogger.new)

View file

@ -12,5 +12,9 @@ development:
<<: *default
host: "chexpire.local"
production:
action_mailer_config:
delivery_method: :sendmail
# test configuration included in file used by CI services
<%= IO.read Rails.root.join("config", "chexpire.test.yml") %>

View file

@ -44,6 +44,10 @@ Rails.application.configure do
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.
config.active_support.deprecation = :log

View file

@ -65,10 +65,12 @@ Rails.application.configure do
# 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.
# 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.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
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true

View file

@ -67,6 +67,9 @@ Rails.application.configure do
# config.action_mailer.raise_delivery_errors = false
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
# the I18n.default_locale when a translation cannot be found).

View file

@ -17,7 +17,11 @@ class UsersTest < ApplicationSystemTestCase
fill_in("user[password_confirmation]", with: password)
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
user = User.find_by!(email: email, confirmed_at: nil)