diff --git a/app/views/registrar/registrar_nameservers/_form.html.erb b/app/views/registrar/registrar_nameservers/_form.html.erb
index bc748d412..7d4935a53 100644
--- a/app/views/registrar/registrar_nameservers/_form.html.erb
+++ b/app/views/registrar/registrar_nameservers/_form.html.erb
@@ -5,7 +5,7 @@
- <%= text_field_tag :old_hostname, nil, autofocus: true, required: true,
+ <%= text_field_tag :old_hostname, params[:old_hostname], autofocus: true, required: true,
class: 'form-control' %>
@@ -16,7 +16,7 @@
- <%= text_field_tag :new_hostname, nil, required: true, class: 'form-control' %>
+ <%= text_field_tag :new_hostname, params[:new_hostname], required: true, class: 'form-control' %>
@@ -26,7 +26,7 @@
- <%= text_area_tag :ipv4, nil, class: 'form-control' %>
+ <%= text_area_tag :ipv4, params[:ipv4], class: 'form-control' %>
@@ -36,7 +36,7 @@
- <%= text_area_tag :ipv6, nil, class: 'form-control' %>
+ <%= text_area_tag :ipv6, params[:ipv6], class: 'form-control' %>
diff --git a/test/integration/registrar/nameserver_replacement_test.rb b/test/integration/registrar/nameserver_replacement_test.rb
index a6c1dcb7b..9523d2bbd 100644
--- a/test/integration/registrar/nameserver_replacement_test.rb
+++ b/test/integration/registrar/nameserver_replacement_test.rb
@@ -42,8 +42,16 @@ class RegistrarNameserverReplacementTest < ActionDispatch::IntegrationTest
visit registrar_domains_url
click_link 'Replace nameserver'
+ fill_in 'Old hostname', with: 'old hostname'
+ fill_in 'New hostname', with: 'new hostname'
+ fill_in 'ipv4', with: 'ipv4'
+ fill_in 'ipv6', with: 'ipv6'
click_on 'Replace nameserver'
assert_text 'epic fail'
+ assert_field 'Old hostname', with: 'old hostname'
+ assert_field 'New hostname', with: 'new hostname'
+ assert_field 'ipv4', with: 'ipv4'
+ assert_field 'ipv6', with: 'ipv6'
end
end