From dff3a80592d6eb2a1b4d374d12de0d835be2aff2 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Tue, 11 Aug 2015 13:01:09 +0300 Subject: [PATCH] Refactor test #2809 --- spec/epp/domain_spec.rb | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/spec/epp/domain_spec.rb b/spec/epp/domain_spec.rb index c886724cf..892665a09 100644 --- a/spec/epp/domain_spec.rb +++ b/spec/epp/domain_spec.rb @@ -1008,30 +1008,26 @@ describe 'EPP Domain', epp: true do # should show up in other registrar's poll - response = login_as :registrar2 do - epp_plain_request(@epp_xml.session.poll) + login_as :registrar2 do + response = epp_plain_request(@epp_xml.session.poll) + response[:msg].should == 'Command completed successfully; ack to dequeue' + msg_q = response[:parsed].css('msgQ') + msg_q.css('qDate').text.should_not be_blank + msg_q.css('msg').text.should == 'Transfer requested.' + msg_q.first['id'].should_not be_blank + msg_q.first['count'].should == '1' + + xml = @epp_xml.session.poll(poll: { + value: '', attrs: { op: 'ack', msgID: msg_q.first['id'] } + }) + + response = epp_plain_request(xml) + response[:msg].should == 'Command completed successfully' + msg_q = response[:parsed].css('msgQ') + msg_q.first['id'].should_not be_blank + msg_q.first['count'].should == '0' end - response[:msg].should == 'Command completed successfully; ack to dequeue' - msg_q = response[:parsed].css('msgQ') - msg_q.css('qDate').text.should_not be_blank - msg_q.css('msg').text.should == 'Transfer requested.' - msg_q.first['id'].should_not be_blank - msg_q.first['count'].should == '1' - - xml = @epp_xml.session.poll(poll: { - value: '', attrs: { op: 'ack', msgID: msg_q.first['id'] } - }) - - response = login_as :registrar2 do - epp_plain_request(xml) - end - - response[:msg].should == 'Command completed successfully' - msg_q = response[:parsed].css('msgQ') - msg_q.first['id'].should_not be_blank - msg_q.first['count'].should == '0' - create_settings end