mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Conflicts: CHANGELOG.md app/mailers/domain_mailer.rb app/models/domain.rb app/views/layouts/registrant/application.haml config/application-example.yml config/locales/en.yml config/routes.rb spec/mailers/domain_mailer_spec.rb
58 lines
1.6 KiB
Ruby
58 lines
1.6 KiB
Ruby
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
|
|
<<<<<<< HEAD
|
|
=======
|
|
@domain.registrant_verification_token = '123'
|
|
>>>>>>> 0ddd2b6f32fa7e9abec8b2e7c88173585a78f3dd
|
|
@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
|