-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #338 from internetee/registry-330
Registry 330
- Loading branch information
Showing
9 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,59 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe DomainMailer do | ||
describe '#registrant_updated_notification_for_new_registrant', db: true do | ||
subject(:message) { described_class.registrant_updated_notification_for_new_registrant(55, 55, 55, true) } | ||
|
||
context 'when contact address processing is enabled' do | ||
before :example do | ||
allow(Contact).to receive(:address_processing?).and_return(true) | ||
create(:domain, id: 55) | ||
create(:registrant_with_address, id: 55) | ||
end | ||
|
||
it 'sends message' do | ||
expect { message.deliver }.to change { ActionMailer::Base.deliveries.count }.by(1) | ||
end | ||
end | ||
|
||
context 'when contact address processing is disabled' do | ||
before :example do | ||
allow(Contact).to receive(:address_processing?).and_return(false) | ||
create(:domain, id: 55) | ||
create(:registrant_without_address, id: 55) | ||
end | ||
|
||
it 'sends message' do | ||
expect { message.deliver }.to change { ActionMailer::Base.deliveries.count }.by(1) | ||
end | ||
end | ||
end | ||
|
||
describe '#registrant_updated_notification_for_old_registrant', db: true do | ||
subject(:message) { described_class.registrant_updated_notification_for_old_registrant(55, 55, 55, true) } | ||
|
||
context 'when contact address processing is enabled' do | ||
before :example do | ||
allow(Contact).to receive(:address_processing?).and_return(true) | ||
create(:domain, id: 55) | ||
create(:registrant_with_address, id: 55) | ||
end | ||
|
||
it 'sends message' do | ||
expect { message.deliver }.to change { ActionMailer::Base.deliveries.count }.by(1) | ||
end | ||
end | ||
|
||
context 'when contact address processing is disabled' do | ||
before :example do | ||
allow(Contact).to receive(:address_processing?).and_return(false) | ||
create(:domain, id: 55) | ||
create(:registrant_without_address, id: 55) | ||
end | ||
|
||
it 'sends message' do | ||
expect { message.deliver }.to change { ActionMailer::Base.deliveries.count }.by(1) | ||
end | ||
end | ||
end | ||
end |