mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
All system now supports legacy CID format
This commit is contained in:
parent
1f504e08ea
commit
928ce24132
9 changed files with 137 additions and 56 deletions
32
spec/models/epp_contact_spec.rb
Normal file
32
spec/models/epp_contact_spec.rb
Normal file
|
@ -0,0 +1,32 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe Epp::Contact, '.check_availability' do
|
||||
before do
|
||||
Fabricate(:contact, code: 'asd12')
|
||||
Fabricate(:contact, code: 'asd13')
|
||||
end
|
||||
|
||||
it 'should return array if argument is string' do
|
||||
response = Epp::Contact.check_availability('asd12')
|
||||
response.class.should == Array
|
||||
response.length.should == 1
|
||||
end
|
||||
|
||||
it 'should return in_use and available codes' do
|
||||
code = Contact.first.code
|
||||
code_ = Contact.last.code
|
||||
|
||||
response = Epp::Contact.check_availability([code, code_, 'asd14'])
|
||||
response.class.should == Array
|
||||
response.length.should == 3
|
||||
|
||||
response[0][:avail].should == 0
|
||||
response[0][:code].should == code
|
||||
|
||||
response[1][:avail].should == 0
|
||||
response[1][:code].should == code_
|
||||
|
||||
response[2][:avail].should == 1
|
||||
response[2][:code].should == 'asd14'
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue