-
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.
Do not show address at contact view in registrar area unless address_…
…processing is enabled #251
- Loading branch information
Artur Beljajev
committed
Dec 19, 2016
1 parent
dfe3f54
commit 48f752a
Showing
2 changed files
with
37 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'registrar/contacts/show' do | ||
let(:contact) { instance_spy(Depp::Contact, id: 1, name: 'test') } | ||
|
||
before do | ||
assign(:contact, contact) | ||
stub_template 'shared/_title' => '' | ||
stub_template 'registrar/contacts/partials/_general' => '' | ||
stub_template 'registrar/contacts/partials/_statuses' => '' | ||
stub_template 'registrar/contacts/partials/_domains' => '' | ||
stub_template 'registrar/contacts/partials/_address' => 'address info' | ||
end | ||
|
||
context 'when address processing is enabled' do | ||
before do | ||
allow(Contact).to receive(:address_processing?).and_return(true) | ||
end | ||
|
||
it 'has address' do | ||
render | ||
expect(rendered).to have_text('address info') | ||
end | ||
end | ||
|
||
context 'when address processing is disabled' do | ||
before do | ||
allow(Contact).to receive(:address_processing?).and_return(false) | ||
end | ||
|
||
it 'has no address' do | ||
render | ||
expect(rendered).to_not have_text('address info') | ||
end | ||
end | ||
end |