mirror of
https://github.com/internetee/registry.git
synced 2025-08-11 20:19:34 +02:00
Merge branch 'staging' of github.com:internetee/registry into staging
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
This commit is contained in:
parent
360fb57a68
commit
2dddace1b8
12 changed files with 97 additions and 55 deletions
3
Gemfile
3
Gemfile
|
@ -94,6 +94,9 @@ gem 'uuidtools', '2.1.5' # For unique IDs (used by the epp gem)
|
||||||
gem 'que', '0.10.0'
|
gem 'que', '0.10.0'
|
||||||
gem 'que-web', '0.4.0'
|
gem 'que-web', '0.4.0'
|
||||||
gem 'daemons-rails', '1.2.1'
|
gem 'daemons-rails', '1.2.1'
|
||||||
|
gem 'que_mailer',
|
||||||
|
github: 'prehnRA/que-mailer',
|
||||||
|
branch: 'master'
|
||||||
|
|
||||||
# for importing legacy db
|
# for importing legacy db
|
||||||
gem 'activerecord-import', '0.7.0' # for inserting dummy data
|
gem 'activerecord-import', '0.7.0' # for inserting dummy data
|
||||||
|
|
13
Gemfile.lock
13
Gemfile.lock
|
@ -24,6 +24,18 @@ GIT
|
||||||
hpricot
|
hpricot
|
||||||
libxml-ruby
|
libxml-ruby
|
||||||
|
|
||||||
|
GIT
|
||||||
|
remote: https://github.com/prehnRA/que-mailer.git
|
||||||
|
revision: 32156f258993348b50a7db2a41eed1bdb0bf4fab
|
||||||
|
branch: master
|
||||||
|
specs:
|
||||||
|
que_mailer (0.0.2)
|
||||||
|
actionmailer (>= 4.0)
|
||||||
|
activesupport (>= 4.0)
|
||||||
|
pg (~> 0)
|
||||||
|
que (~> 0.6)
|
||||||
|
rails (>= 4.0)
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: https://github.com/rubysec/bundler-audit.git
|
remote: https://github.com/rubysec/bundler-audit.git
|
||||||
revision: f89ef7fae1090bbad825ea76812d56d72b417055
|
revision: f89ef7fae1090bbad825ea76812d56d72b417055
|
||||||
|
@ -599,6 +611,7 @@ DEPENDENCIES
|
||||||
pry (= 0.10.1)
|
pry (= 0.10.1)
|
||||||
que (= 0.10.0)
|
que (= 0.10.0)
|
||||||
que-web (= 0.4.0)
|
que-web (= 0.4.0)
|
||||||
|
que_mailer!
|
||||||
railroady (= 1.3.0)
|
railroady (= 1.3.0)
|
||||||
rails (= 4.2.4)
|
rails (= 4.2.4)
|
||||||
rails-settings-cached (= 0.4.1)
|
rails-settings-cached (= 0.4.1)
|
||||||
|
|
|
@ -9,7 +9,7 @@ class DomainDeleteConfirmJob < Que::Job
|
||||||
domain.apply_pending_delete!
|
domain.apply_pending_delete!
|
||||||
domain.clean_pendings!
|
domain.clean_pendings!
|
||||||
when RegistrantVerification::REJECTED
|
when RegistrantVerification::REJECTED
|
||||||
DomainMailer.pending_delete_rejected_notification(domain).deliver_now
|
DomainMailer.pending_delete_rejected_notification(domain_id).deliver
|
||||||
domain.statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
|
domain.statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
|
||||||
domain.poll_message!(:poll_pending_delete_rejected_by_registrant)
|
domain.poll_message!(:poll_pending_delete_rejected_by_registrant)
|
||||||
domain.clean_pendings!
|
domain.clean_pendings!
|
||||||
|
|
|
@ -11,7 +11,7 @@ class DomainUpdateConfirmJob < Que::Job
|
||||||
end
|
end
|
||||||
domain.clean_pendings!
|
domain.clean_pendings!
|
||||||
when RegistrantVerification::REJECTED
|
when RegistrantVerification::REJECTED
|
||||||
DomainMailer.pending_update_rejected_notification_for_new_registrant(domain).deliver_now
|
DomainMailer.pending_update_rejected_notification_for_new_registrant(domain_id).deliver
|
||||||
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
|
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
|
||||||
domain.clean_pendings!
|
domain.clean_pendings!
|
||||||
domain.instance_variable_set("@changed_attributes", domain.changed_attributes.merge("statuses"=>[]))
|
domain.instance_variable_set("@changed_attributes", domain.changed_attributes.merge("statuses"=>[]))
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
class ContactMailer < ApplicationMailer
|
class ContactMailer < ApplicationMailer
|
||||||
def email_updated(email, contact)
|
include Que::Mailer
|
||||||
|
|
||||||
|
def email_updated(email_id, contact_id)
|
||||||
|
email = Email.find_by(id: email_id)
|
||||||
|
@contact = Contact.find_by(id: contact_id)
|
||||||
|
return unless email || @contact
|
||||||
return if delivery_off?(contact)
|
return if delivery_off?(contact)
|
||||||
|
|
||||||
@contact = contact
|
|
||||||
|
|
||||||
return if whitelist_blocked?(email)
|
return if whitelist_blocked?(email)
|
||||||
|
|
||||||
begin
|
begin
|
||||||
mail(to: format(email), subject: "#{I18n.t(:contact_email_update_subject)} [#{@contact.code}]")
|
mail(to: format(email), subject: "#{I18n.t(:contact_email_update_subject)} [#{@contact.code}]")
|
||||||
rescue EOFError,
|
rescue EOFError,
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
class DomainMailer < ApplicationMailer
|
class DomainMailer < ApplicationMailer
|
||||||
def pending_update_request_for_old_registrant(domain)
|
include Que::Mailer
|
||||||
@domain = domain
|
|
||||||
|
def pending_update_request_for_old_registrant(domain_id)
|
||||||
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless @domain
|
||||||
return if delivery_off?(@domain)
|
return if delivery_off?(@domain)
|
||||||
|
|
||||||
if @domain.registrant_verification_token.blank?
|
if @domain.registrant_verification_token.blank?
|
||||||
|
@ -24,8 +27,9 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def pending_update_notification_for_new_registrant(domain)
|
def pending_update_notification_for_new_registrant(domain_id)
|
||||||
@domain = domain
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless @domain
|
||||||
return if delivery_off?(@domain)
|
return if delivery_off?(@domain)
|
||||||
|
|
||||||
if @domain.registrant_verification_token.blank?
|
if @domain.registrant_verification_token.blank?
|
||||||
|
@ -47,8 +51,9 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def registrant_updated_notification_for_new_registrant(domain)
|
def registrant_updated_notification_for_new_registrant(domain_id)
|
||||||
@domain = domain
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless @domain
|
||||||
return if delivery_off?(@domain)
|
return if delivery_off?(@domain)
|
||||||
|
|
||||||
return if whitelist_blocked?(@domain.registrant_email)
|
return if whitelist_blocked?(@domain.registrant_email)
|
||||||
|
@ -57,8 +62,9 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def registrant_updated_notification_for_old_registrant(domain)
|
def registrant_updated_notification_for_old_registrant(domain_id)
|
||||||
@domain = domain
|
domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless domain
|
||||||
return if delivery_off?(@domain)
|
return if delivery_off?(@domain)
|
||||||
|
|
||||||
@old_registrant_email = domain.registrant_email # Nb! before applying pending updates
|
@old_registrant_email = domain.registrant_email # Nb! before applying pending updates
|
||||||
|
@ -69,8 +75,9 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def pending_update_rejected_notification_for_new_registrant(domain)
|
def pending_update_rejected_notification_for_new_registrant(domain_id)
|
||||||
@domain = domain
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless @domain
|
||||||
# no delivery off control, driggered by que, no epp request
|
# no delivery off control, driggered by que, no epp request
|
||||||
|
|
||||||
@new_registrant_email = @domain.pending_json['new_registrant_email']
|
@new_registrant_email = @domain.pending_json['new_registrant_email']
|
||||||
|
@ -82,8 +89,9 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def pending_update_expired_notification_for_new_registrant(domain)
|
def pending_update_expired_notification_for_new_registrant(domain_id)
|
||||||
@domain = domain
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless @domain
|
||||||
# no delivery off control, driggered by cron, no epp request
|
# no delivery off control, driggered by cron, no epp request
|
||||||
|
|
||||||
@new_registrant_email = @domain.pending_json['new_registrant_email']
|
@new_registrant_email = @domain.pending_json['new_registrant_email']
|
||||||
|
@ -99,8 +107,9 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def pending_deleted(domain)
|
def pending_deleted(domain_id)
|
||||||
@domain = domain
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless @domain
|
||||||
return if delivery_off?(@domain)
|
return if delivery_off?(@domain)
|
||||||
|
|
||||||
if @domain.registrant_verification_token.blank?
|
if @domain.registrant_verification_token.blank?
|
||||||
|
@ -124,8 +133,10 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def pending_delete_rejected_notification(domain)
|
def pending_delete_rejected_notification(domain_id)
|
||||||
@domain = domain
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless @domain
|
||||||
|
return if delivery_off?(@domain)
|
||||||
# no delivery off control, driggered by que, no epp request
|
# no delivery off control, driggered by que, no epp request
|
||||||
|
|
||||||
if @domain.registrant_verification_token.blank?
|
if @domain.registrant_verification_token.blank?
|
||||||
|
@ -144,8 +155,10 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def pending_delete_expired_notification(domain)
|
def pending_delete_expired_notification(domain_id)
|
||||||
@domain = domain
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless @domain
|
||||||
|
return if delivery_off?(@domain)
|
||||||
# no delivery off control, driggered by cron, no epp request
|
# no delivery off control, driggered by cron, no epp request
|
||||||
|
|
||||||
return if whitelist_blocked?(@domain.registrant.email)
|
return if whitelist_blocked?(@domain.registrant.email)
|
||||||
|
@ -154,8 +167,10 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_confirmation(domain)
|
def delete_confirmation(domain_id)
|
||||||
@domain = domain
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return unless @domain
|
||||||
|
return if delivery_off?(@domain)
|
||||||
|
|
||||||
return if whitelist_blocked?(@domain.registrant.email)
|
return if whitelist_blocked?(@domain.registrant.email)
|
||||||
mail(to: format(@domain.registrant.email),
|
mail(to: format(@domain.registrant.email),
|
||||||
|
@ -163,8 +178,9 @@ class DomainMailer < ApplicationMailer
|
||||||
name: @domain.name)} [#{@domain.name}]")
|
name: @domain.name)} [#{@domain.name}]")
|
||||||
end
|
end
|
||||||
|
|
||||||
def force_delete(domain)
|
def force_delete(domain_id)
|
||||||
@domain = domain
|
@domain = Domain.find_by(id: domain_id)
|
||||||
|
return if delivery_off?(@domain)
|
||||||
emails = ([@domain.registrant.email] + @domain.admin_contacts.map { |x| format(x.email) }).uniq
|
emails = ([@domain.registrant.email] + @domain.admin_contacts.map { |x| format(x.email) }).uniq
|
||||||
return if whitelist_blocked?(emails)
|
return if whitelist_blocked?(emails)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,15 @@
|
||||||
class InvoiceMailer < ApplicationMailer
|
class InvoiceMailer < ApplicationMailer
|
||||||
def invoice_email(invoice, pdf)
|
include Que::Mailer
|
||||||
return if whitelist_blocked?(invoice.billing_email)
|
|
||||||
|
def invoice_email(invoice_id, html)
|
||||||
|
@invoice = Invoice.find_by(id: invoice_id)
|
||||||
|
return unless @invoice
|
||||||
|
return if whitelist_blocked?(@invoice.billing_email)
|
||||||
|
|
||||||
|
kit = PDFKit.new(html)
|
||||||
|
pdf = kit.to_pdf
|
||||||
|
invoice = @invoice
|
||||||
|
|
||||||
@invoice = invoice
|
|
||||||
attachments[invoice.pdf_name] = pdf
|
attachments[invoice.pdf_name] = pdf
|
||||||
mail(to: format(invoice.billing_email), subject: invoice)
|
mail(to: format(invoice.billing_email), subject: invoice)
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Contact < ActiveRecord::Base
|
||||||
emails << domains.map(&:registrant_email) if domains.present?
|
emails << domains.map(&:registrant_email) if domains.present?
|
||||||
emails = emails.flatten.uniq
|
emails = emails.flatten.uniq
|
||||||
emails.each do |e|
|
emails.each do |e|
|
||||||
ContactMailer.email_updated(e, self).deliver_now
|
ContactMailer.email_updated(e.id, id).deliver
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -238,10 +238,10 @@ class Domain < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
count += 1
|
count += 1
|
||||||
if domain.pending_update?
|
if domain.pending_update?
|
||||||
DomainMailer.pending_update_expired_notification_for_new_registrant(domain).deliver_now
|
DomainMailer.pending_update_expired_notification_for_new_registrant(id).deliver
|
||||||
end
|
end
|
||||||
if domain.pending_delete? || domain.pending_delete_confirmation?
|
if domain.pending_delete? || domain.pending_delete_confirmation?
|
||||||
DomainMailer.pending_delete_expired_notification(domain).deliver_now
|
DomainMailer.pending_delete_expired_notification(id).deliver
|
||||||
end
|
end
|
||||||
domain.clean_pendings!
|
domain.clean_pendings!
|
||||||
unless Rails.env.test?
|
unless Rails.env.test?
|
||||||
|
@ -428,8 +428,8 @@ class Domain < ActiveRecord::Base
|
||||||
new_registrant_email = registrant.email
|
new_registrant_email = registrant.email
|
||||||
new_registrant_name = registrant.name
|
new_registrant_name = registrant.name
|
||||||
|
|
||||||
DomainMailer.pending_update_request_for_old_registrant(self).deliver_now
|
DomainMailer.pending_update_request_for_old_registrant(id).deliver
|
||||||
DomainMailer.pending_update_notification_for_new_registrant(self).deliver_now
|
DomainMailer.pending_update_notification_for_new_registrant(id).deliver
|
||||||
|
|
||||||
reload # revert back to original
|
reload # revert back to original
|
||||||
|
|
||||||
|
@ -489,7 +489,7 @@ class Domain < ActiveRecord::Base
|
||||||
pending_delete_confirmation!
|
pending_delete_confirmation!
|
||||||
save(validate: false) # should check if this did succeed
|
save(validate: false) # should check if this did succeed
|
||||||
|
|
||||||
DomainMailer.pending_deleted(self).deliver_now
|
DomainMailer.pending_deleted(id).deliver
|
||||||
end
|
end
|
||||||
|
|
||||||
def pricelist(operation, period_i = nil, unit = nil)
|
def pricelist(operation, period_i = nil, unit = nil)
|
||||||
|
@ -619,7 +619,7 @@ class Domain < ActiveRecord::Base
|
||||||
registrar.messages.create!(
|
registrar.messages.create!(
|
||||||
body: I18n.t('force_delete_set_on_domain', domain: name)
|
body: I18n.t('force_delete_set_on_domain', domain: name)
|
||||||
)
|
)
|
||||||
DomainMailer.force_delete(self).deliver_now
|
DomainMailer.force_delete(id).deliver
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
false
|
false
|
||||||
|
|
|
@ -478,7 +478,7 @@ class Epp::Domain < Domain
|
||||||
# rubocop: enable Metrics/CyclomaticComplexity
|
# rubocop: enable Metrics/CyclomaticComplexity
|
||||||
|
|
||||||
def apply_pending_update!
|
def apply_pending_update!
|
||||||
old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(self)
|
old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(id)
|
||||||
preclean_pendings
|
preclean_pendings
|
||||||
user = ApiUser.find(pending_json['current_user_id'])
|
user = ApiUser.find(pending_json['current_user_id'])
|
||||||
frame = Nokogiri::XML(pending_json['frame'])
|
frame = Nokogiri::XML(pending_json['frame'])
|
||||||
|
@ -488,8 +488,8 @@ class Epp::Domain < Domain
|
||||||
return unless update(frame, user, false)
|
return unless update(frame, user, false)
|
||||||
clean_pendings!
|
clean_pendings!
|
||||||
self.deliver_emails = true # turn on email delivery
|
self.deliver_emails = true # turn on email delivery
|
||||||
DomainMailer.registrant_updated_notification_for_new_registrant(self).deliver_now
|
DomainMailer.registrant_updated_notification_for_new_registrant(id).deliver
|
||||||
old_registrant_email.deliver_now
|
old_registrant_email.deliver
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -497,7 +497,7 @@ class Epp::Domain < Domain
|
||||||
preclean_pendings
|
preclean_pendings
|
||||||
statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
|
statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
|
||||||
statuses.delete(DomainStatus::PENDING_DELETE)
|
statuses.delete(DomainStatus::PENDING_DELETE)
|
||||||
DomainMailer.delete_confirmation(self).deliver_now
|
DomainMailer.delete_confirmation(id).deliver
|
||||||
|
|
||||||
# TODO: confirm that this actually makes sense
|
# TODO: confirm that this actually makes sense
|
||||||
clean_pendings! if valid? && set_pending_delete!
|
clean_pendings! if valid? && set_pending_delete!
|
||||||
|
|
|
@ -117,7 +117,7 @@ class Invoice < ActiveRecord::Base
|
||||||
return false unless valid?
|
return false unless valid?
|
||||||
return false unless billing_email.present?
|
return false unless billing_email.present?
|
||||||
|
|
||||||
InvoiceMailer.invoice_email(self, pdf(html)).deliver_now
|
InvoiceMailer.invoice_email(id, html).deliver
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe DomainMailer do
|
||||||
before :all do
|
before :all do
|
||||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||||
@domain = Fabricate(:domain, registrant: @registrant)
|
@domain = Fabricate(:domain, registrant: @registrant)
|
||||||
@mail = DomainMailer.pending_update_request_for_old_registrant(@domain)
|
@mail = DomainMailer.pending_update_request_for_old_registrant(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not render email subject' do
|
it 'should not render email subject' do
|
||||||
|
@ -38,7 +38,7 @@ describe DomainMailer do
|
||||||
@domain.registrant_verification_token = '123'
|
@domain.registrant_verification_token = '123'
|
||||||
@domain.registrant_verification_asked_at = Time.zone.now
|
@domain.registrant_verification_asked_at = Time.zone.now
|
||||||
@domain.registrant = @new_registrant
|
@domain.registrant = @new_registrant
|
||||||
@mail = DomainMailer.pending_update_request_for_old_registrant(@domain)
|
@mail = DomainMailer.pending_update_request_for_old_registrant(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
@ -71,7 +71,7 @@ describe DomainMailer do
|
||||||
@domain.registrant_verification_token = '123'
|
@domain.registrant_verification_token = '123'
|
||||||
@domain.registrant_verification_asked_at = Time.zone.now
|
@domain.registrant_verification_asked_at = Time.zone.now
|
||||||
@domain.registrant = @new_registrant
|
@domain.registrant = @new_registrant
|
||||||
@mail = DomainMailer.pending_update_notification_for_new_registrant(@domain)
|
@mail = DomainMailer.pending_update_notification_for_new_registrant(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
@ -100,7 +100,7 @@ describe DomainMailer do
|
||||||
@domain.registrant_verification_token = '123'
|
@domain.registrant_verification_token = '123'
|
||||||
@domain.registrant_verification_asked_at = Time.zone.now
|
@domain.registrant_verification_asked_at = Time.zone.now
|
||||||
@domain.registrant = @new_registrant
|
@domain.registrant = @new_registrant
|
||||||
@mail = DomainMailer.pending_update_notification_for_new_registrant(@domain)
|
@mail = DomainMailer.pending_update_notification_for_new_registrant(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
@ -128,7 +128,7 @@ describe DomainMailer do
|
||||||
@domain.deliver_emails = true
|
@domain.deliver_emails = true
|
||||||
@domain.pending_json['new_registrant_email'] = 'new@example.org'
|
@domain.pending_json['new_registrant_email'] = 'new@example.org'
|
||||||
@domain.pending_json['new_registrant_name'] = 'test name'
|
@domain.pending_json['new_registrant_name'] = 'test name'
|
||||||
@mail = DomainMailer.pending_update_rejected_notification_for_new_registrant(@domain)
|
@mail = DomainMailer.pending_update_rejected_notification_for_new_registrant(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
@ -153,7 +153,7 @@ describe DomainMailer do
|
||||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||||
@domain = Fabricate(:domain, registrant: @registrant)
|
@domain = Fabricate(:domain, registrant: @registrant)
|
||||||
@domain.deliver_emails = true
|
@domain.deliver_emails = true
|
||||||
@mail = DomainMailer.registrant_updated_notification_for_new_registrant(@domain)
|
@mail = DomainMailer.registrant_updated_notification_for_new_registrant(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
@ -178,7 +178,7 @@ describe DomainMailer do
|
||||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||||
@domain = Fabricate(:domain, registrant: @registrant)
|
@domain = Fabricate(:domain, registrant: @registrant)
|
||||||
@domain.deliver_emails = true
|
@domain.deliver_emails = true
|
||||||
@mail = DomainMailer.registrant_updated_notification_for_old_registrant(@domain)
|
@mail = DomainMailer.registrant_updated_notification_for_old_registrant(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
@ -202,7 +202,7 @@ describe DomainMailer do
|
||||||
before :all do
|
before :all do
|
||||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||||
@domain = Fabricate(:domain, registrant: @registrant)
|
@domain = Fabricate(:domain, registrant: @registrant)
|
||||||
@mail = DomainMailer.pending_deleted(@domain)
|
@mail = DomainMailer.pending_deleted(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not render email subject' do
|
it 'should not render email subject' do
|
||||||
|
@ -229,7 +229,7 @@ describe DomainMailer do
|
||||||
@domain.deliver_emails = true
|
@domain.deliver_emails = true
|
||||||
@domain.registrant_verification_token = '123'
|
@domain.registrant_verification_token = '123'
|
||||||
@domain.registrant_verification_asked_at = Time.zone.now
|
@domain.registrant_verification_asked_at = Time.zone.now
|
||||||
@mail = DomainMailer.pending_deleted(@domain)
|
@mail = DomainMailer.pending_deleted(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
@ -260,7 +260,7 @@ describe DomainMailer do
|
||||||
@domain.deliver_emails = true
|
@domain.deliver_emails = true
|
||||||
@domain.registrant_verification_token = '123'
|
@domain.registrant_verification_token = '123'
|
||||||
@domain.registrant_verification_asked_at = Time.zone.now
|
@domain.registrant_verification_asked_at = Time.zone.now
|
||||||
@mail = DomainMailer.pending_delete_rejected_notification(@domain)
|
@mail = DomainMailer.pending_delete_rejected_notification(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
@ -287,7 +287,7 @@ describe DomainMailer do
|
||||||
@domain.deliver_emails = true
|
@domain.deliver_emails = true
|
||||||
@domain.registrant_verification_token = '123'
|
@domain.registrant_verification_token = '123'
|
||||||
@domain.registrant_verification_asked_at = Time.zone.now
|
@domain.registrant_verification_asked_at = Time.zone.now
|
||||||
@mail = DomainMailer.pending_delete_expired_notification(@domain)
|
@mail = DomainMailer.pending_delete_expired_notification(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
@ -314,7 +314,7 @@ describe DomainMailer do
|
||||||
@domain.deliver_emails = true
|
@domain.deliver_emails = true
|
||||||
@domain.registrant_verification_token = '123'
|
@domain.registrant_verification_token = '123'
|
||||||
@domain.registrant_verification_asked_at = Time.zone.now
|
@domain.registrant_verification_asked_at = Time.zone.now
|
||||||
@mail = DomainMailer.delete_confirmation(@domain)
|
@mail = DomainMailer.delete_confirmation(@domain.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should render email subject' do
|
it 'should render email subject' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue