mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Do not show address at contact view in registrar area unless address_processing is enabled
#251
This commit is contained in:
parent
dfe3f545b0
commit
48f752adf7
2 changed files with 37 additions and 1 deletions
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-6= render 'registrar/contacts/partials/general'
|
.col-md-6= render 'registrar/contacts/partials/general'
|
||||||
.col-md-6= render 'registrar/contacts/partials/address'
|
.col-md-6= render 'registrar/contacts/partials/address' if Contact.address_processing?
|
||||||
.row
|
.row
|
||||||
.col-md-12= render 'registrar/contacts/partials/statuses', statuses: @contact.statuses
|
.col-md-12= render 'registrar/contacts/partials/statuses', statuses: @contact.statuses
|
||||||
.row
|
.row
|
||||||
|
|
36
spec/views/registrar/contacts/show.haml_spec.rb
Normal file
36
spec/views/registrar/contacts/show.haml_spec.rb
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue