mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 18:59:38 +02:00
Registrant change confirmation logic
This commit is contained in:
parent
762054e5f1
commit
6c47124a28
15 changed files with 292 additions and 17 deletions
54
spec/mailers/domain_mailer_spec.rb
Normal file
54
spec/mailers/domain_mailer_spec.rb
Normal file
|
@ -0,0 +1,54 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe DomainMailer do
|
||||
describe 'registrant changed notification when delivery turned off' do
|
||||
before :all do
|
||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||
@domain = Fabricate(:domain, registrant: @registrant)
|
||||
@mail = DomainMailer.registrant_updated(@domain)
|
||||
end
|
||||
|
||||
it 'should not render email subject' do
|
||||
@mail.subject.should == nil
|
||||
end
|
||||
|
||||
it 'should not have sender email' do
|
||||
@mail.from.should == nil
|
||||
end
|
||||
|
||||
it 'should not have reveiver email' do
|
||||
@mail.to.should == nil
|
||||
end
|
||||
|
||||
it 'should not render body' do
|
||||
@mail.body.should == ''
|
||||
end
|
||||
end
|
||||
|
||||
describe 'email changed notification' do
|
||||
before :all do
|
||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||
@new_registrant = Fabricate(:registrant, email: 'test@example.org')
|
||||
@domain = Fabricate(:domain, registrant: @registrant)
|
||||
@domain.deliver_emails = true
|
||||
@domain.registrant = @new_registrant
|
||||
@mail = DomainMailer.registrant_updated(@domain)
|
||||
end
|
||||
|
||||
it 'should render email subject' do
|
||||
@mail.subject.should =~ /Kinnitustaotlus domeeni/
|
||||
end
|
||||
|
||||
it 'should have sender email' do
|
||||
@mail.from.should == ["noreply@internet.ee"]
|
||||
end
|
||||
|
||||
it 'should send confirm email to old registrant email' do
|
||||
@mail.to.should == ["test@example.com"]
|
||||
end
|
||||
|
||||
it 'should render body' do
|
||||
@mail.body.encoded.should =~ /Registrisse laekus taotlus domeeni/
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue