From 8b5428fa3b9ae60a4412c22bde1a2723b58ad446 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Thu, 13 Aug 2015 12:33:20 +0300 Subject: [PATCH] Add test for updating domain pw #2833 --- config/initializers/settings.rb | 3 ++- spec/epp/domain_spec.rb | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/config/initializers/settings.rb b/config/initializers/settings.rb index 3433f9f4f..716fd5d52 100644 --- a/config/initializers/settings.rb +++ b/config/initializers/settings.rb @@ -1,4 +1,4 @@ -TEST_EMAILS = +TEST_EMAILS = if Rails.env.test? %w( test@example.com @@ -9,5 +9,6 @@ TEST_EMAILS = new@example.com ) else + ENV['whitelist_emails_for_staging'] ||= '' ENV['whitelist_emails_for_staging'].split(',').map(&:strip) end diff --git a/spec/epp/domain_spec.rb b/spec/epp/domain_spec.rb index a55a62a58..e88bb3a6e 100644 --- a/spec/epp/domain_spec.rb +++ b/spec/epp/domain_spec.rb @@ -1819,6 +1819,22 @@ describe 'EPP Domain', epp: true do d.pending_update?.should == true end + it 'updates a domain and changes auth info' do + response = epp_plain_request(domain_update_xml({ + name: { value: domain.name }, + chg: [ + authInfo: { pw: { value: 'newpw' } } + ] + })) + + response[:results][0][:msg].should == 'Command completed successfully' + response[:results][0][:result_code].should == '1000' + + d = Domain.last + + d.auth_info.should == 'newpw' + end + it 'should not return action pending when changes are invalid' do existing_pw = domain.auth_info