Add test for updating domain pw #2833

This commit is contained in:
Martin Lensment 2015-08-13 12:33:20 +03:00
parent 3c934d70e8
commit 8b5428fa3b
2 changed files with 18 additions and 1 deletions

View file

@ -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

View file

@ -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