Contact fabricator code made dynamic

This commit is contained in:
Andres Keskküla 2014-08-11 16:08:18 +03:00
parent 2f0b0c35d4
commit a01f03a6d5
5 changed files with 11 additions and 11 deletions

View file

@ -59,7 +59,7 @@ describe 'EPP Contact', epp: true do
#TODO tests for missing/invalid/etc ident
it 'deletes contact' do
Fabricate(:contact)
Fabricate(:contact, code: "dwa1234")
response = epp_request('contacts/delete.xml')
expect(response[:result_code]).to eq('1000')
expect(response[:msg]).to eq('Command completed successfully')
@ -75,7 +75,7 @@ describe 'EPP Contact', epp: true do
end
it 'checks contacts' do
Fabricate(:contact)
Fabricate(:contact, code: 'check-1234')
response = epp_request('contacts/check.xml')
expect(response[:result_code]).to eq('1000')
@ -85,8 +85,8 @@ describe 'EPP Contact', epp: true do
expect(ids[0].attributes['avail'].text).to eq('0')
expect(ids[1].attributes['avail'].text).to eq('1')
expect(ids[0].text).to eq('sh8913')
expect(ids[1].text).to eq('sh8914')
expect(ids[0].text).to eq('check-1234')
expect(ids[1].text).to eq('check-4321')
end
@ -97,7 +97,7 @@ describe 'EPP Contact', epp: true do
end
it 'returns info about contact' do
Fabricate(:contact, name: "Johnny Awesome", created_by_id: '1')
Fabricate(:contact, name: "Johnny Awesome", created_by_id: '1', code: 'info-4444')
Fabricate(:address)
response = epp_request('contacts/info.xml')
@ -110,7 +110,7 @@ describe 'EPP Contact', epp: true do
end
it 'it doesn\'t display unassociated object' do
Fabricate(:contact, name:"Johnny Awesome", created_by_id: '240')
Fabricate(:contact, name:"Johnny Awesome", created_by_id: '240', code: 'info-4444')
Fabricate(:epp_user, id: 240)
response = epp_request('contacts/info.xml')

View file

@ -4,8 +4,8 @@
<check>
<contact:check
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
<contact:id>sh8913</contact:id>
<contact:id>sh8914</contact:id>
<contact:id>check-1234</contact:id>
<contact:id>check-4321</contact:id>
</contact:check>
</check>
<clTRID>ABC-12345</clTRID>

View file

@ -4,7 +4,7 @@
<delete>
<contact:delete
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
<contact:id>sh8913</contact:id>
<contact:id>dwa1234</contact:id>
</contact:delete>
</delete>
<clTRID>ABC-12345</clTRID>

View file

@ -4,7 +4,7 @@
<info>
<contact:info
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
<contact:id>sh8913</contact:id>
<contact:id>info-4444</contact:id>
<contact:authInfo>
<contact:pw>2fooBAR</contact:pw>
</contact:authInfo>

View file

@ -3,7 +3,7 @@ Fabricator(:contact) do
phone '+372.12345678'
email Faker::Internet.email
ident '37605030299'
code 'sh8913'
code "sh#{Faker::Number.number(4)}"
ident_type 'op'
address
end