-
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 #337 from internetee/registry-290
Hide address form fields when adding/editing contact in registrar area
- Loading branch information
Showing
4 changed files
with
54 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,12 @@ | |
.row | ||
.col-md-8 | ||
= render 'registrar/contacts/form_partials/general', f: f | ||
.row | ||
.col-md-8 | ||
= render 'registrar/contacts/form_partials/address', f: f | ||
|
||
- if address_processing? | ||
.row | ||
.col-md-8 | ||
= render 'registrar/contacts/form_partials/address', f: f | ||
|
||
- if [email protected]? | ||
.row | ||
.col-md-8 | ||
|
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,38 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'registrar/contacts/_form' do | ||
let(:contact) { instance_spy(Depp::Contact) } | ||
|
||
before :example do | ||
allow(view).to receive(:f).and_return(ActionView::Helpers::FormBuilder.new(:contact, contact, view, {})) | ||
assign(:contact, contact) | ||
|
||
stub_template 'registrar/shared/_error_messages' => '' | ||
stub_template 'registrar/contacts/form_partials/_general' => '' | ||
stub_template 'registrar/contacts/form_partials/_address' => 'address info' | ||
stub_template 'registrar/contacts/form_partials/_code' => '' | ||
stub_template 'registrar/contacts/form_partials/_legal_document' => '' | ||
end | ||
|
||
context 'when address processing is enabled' do | ||
before do | ||
allow(view).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(view).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 |
51 changes: 0 additions & 51 deletions
51
spec/views/registrar/contacts/form_partials/_address.haml_spec.rb
This file was deleted.
Oops, something went wrong.