mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Remove useless specs
This commit is contained in:
parent
6bab335f5a
commit
65a50a8db0
9 changed files with 0 additions and 152 deletions
|
@ -1,14 +1,6 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Account do
|
||||
it 'has versions' do
|
||||
with_versioning do
|
||||
price = build(:account)
|
||||
price.save!
|
||||
expect(price.versions.size).to be(1)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'registrar validation', db: false do
|
||||
subject(:account) { described_class.new }
|
||||
|
||||
|
|
|
@ -1,16 +1,6 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe AdminUser do
|
||||
context 'with invalid attribute' do
|
||||
before do
|
||||
@admin_user = described_class.new
|
||||
end
|
||||
|
||||
it 'should not have any versions' do
|
||||
@admin_user.versions.should == []
|
||||
end
|
||||
end
|
||||
|
||||
context 'with valid attributes' do
|
||||
before do
|
||||
@admin_user = create(:admin_user)
|
||||
|
|
|
@ -17,10 +17,6 @@ RSpec.describe ApiUser do
|
|||
])
|
||||
end
|
||||
|
||||
it 'should not have any versions' do
|
||||
@api_user.versions.should == []
|
||||
end
|
||||
|
||||
it 'should be active by default' do
|
||||
@api_user.active.should == true
|
||||
end
|
||||
|
@ -41,16 +37,6 @@ RSpec.describe ApiUser do
|
|||
@api_user.valid?
|
||||
@api_user.errors.full_messages.should match_array([])
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
with_versioning do
|
||||
@api_user.versions.should == []
|
||||
@api_user.username = 'newusername'
|
||||
@api_user.save
|
||||
@api_user.errors.full_messages.should match_array([])
|
||||
@api_user.versions.size.should == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '::min_password_length', db: false do
|
||||
|
|
|
@ -5,16 +5,6 @@ RSpec.describe Contact do
|
|||
create(:zone, origin: 'ee')
|
||||
end
|
||||
|
||||
context 'about class' do
|
||||
it 'should have versioning enabled?' do
|
||||
Contact.paper_trail_enabled_for_model?.should == true
|
||||
end
|
||||
|
||||
it 'should have custom log prexied table name for versions table' do
|
||||
ContactVersion.table_name.should == 'log_contacts'
|
||||
end
|
||||
end
|
||||
|
||||
context 'with invalid attribute' do
|
||||
before :example do
|
||||
@contact = Contact.new
|
||||
|
@ -28,10 +18,6 @@ RSpec.describe Contact do
|
|||
@contact.updator.should == nil
|
||||
end
|
||||
|
||||
it 'should not have any versions' do
|
||||
@contact.versions.should == []
|
||||
end
|
||||
|
||||
it 'should not accept long code' do
|
||||
@contact.code = 'verylongcode' * 100
|
||||
@contact.valid?
|
||||
|
@ -66,16 +52,6 @@ RSpec.describe Contact do
|
|||
@contact = create(:contact)
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
with_versioning do
|
||||
@contact.versions.reload.should == []
|
||||
@contact.name = 'New name'
|
||||
@contact.save
|
||||
@contact.errors.full_messages.should match_array([])
|
||||
@contact.versions.size.should == 1
|
||||
end
|
||||
end
|
||||
|
||||
it 'should not overwrite code' do
|
||||
old_code = @contact.code
|
||||
@contact.code = 'CID:REG1:should-not-overwrite-old-code-12345'
|
||||
|
|
|
@ -34,10 +34,6 @@ describe Dnskey do
|
|||
@dnskey.errors.full_messages.should match_array([
|
||||
])
|
||||
end
|
||||
|
||||
it 'should not have any versions' do
|
||||
@dnskey.versions.should == []
|
||||
end
|
||||
end
|
||||
|
||||
context 'with valid attributes' do
|
||||
|
@ -66,15 +62,6 @@ describe Dnskey do
|
|||
@dnskey.errors.full_messages.should match_array([])
|
||||
end
|
||||
|
||||
# TODO: figure out why not working
|
||||
# it 'should have one version' do
|
||||
# with_versioning do
|
||||
# @dnskey.versions.should == []
|
||||
# @dnskey.touch_with_version
|
||||
# @dnskey.versions.size.should == 1
|
||||
# end
|
||||
# end
|
||||
|
||||
it 'generates correct DS digest and DS key tag for ria.ee' do
|
||||
d = create(:domain, name: 'ria.ee', dnskeys: [@dnskey])
|
||||
dk = d.dnskeys.last
|
||||
|
|
|
@ -49,18 +49,6 @@ describe DomainContact do
|
|||
it 'should have Tech name' do
|
||||
@domain_contact.name.should == 'Tech'
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
@domain_contact = create(:domain_contact)
|
||||
|
||||
with_versioning do
|
||||
@domain_contact.versions.reload.should == []
|
||||
@domain_contact.contact = create(:contact)
|
||||
@domain_contact.save!
|
||||
@domain_contact.errors.full_messages.should match_array([])
|
||||
@domain_contact.versions.size.should == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with valid attributes with tech domain contact' do
|
||||
|
@ -82,18 +70,6 @@ describe DomainContact do
|
|||
it 'should have Tech name' do
|
||||
@domain_contact.name.should == 'Tech'
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
@domain_contact = create(:domain_contact)
|
||||
|
||||
with_versioning do
|
||||
@domain_contact.versions.reload.should == []
|
||||
@domain_contact.contact = create(:contact)
|
||||
@domain_contact.save!
|
||||
@domain_contact.errors.full_messages.should match_array([])
|
||||
@domain_contact.versions.size.should == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with valid attributes with admin domain contact' do
|
||||
|
@ -115,15 +91,5 @@ describe DomainContact do
|
|||
it 'should have Tech name' do
|
||||
@domain_contact.name.should == 'Admin'
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
with_versioning do
|
||||
@domain_contact.versions.reload.should == []
|
||||
@domain_contact.contact = create(:contact)
|
||||
@domain_contact.save
|
||||
@domain_contact.errors.full_messages.should match_array([])
|
||||
@domain_contact.versions.size.should == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,10 +33,6 @@ RSpec.describe Domain do
|
|||
@domain = Domain.new
|
||||
end
|
||||
|
||||
it 'should not have any versions' do
|
||||
@domain.versions.should == []
|
||||
end
|
||||
|
||||
it 'should not have whois body' do
|
||||
@domain.whois_record.should == nil
|
||||
end
|
||||
|
@ -489,21 +485,6 @@ RSpec.describe Domain do
|
|||
expect(d.statuses.count).to eq(1)
|
||||
expect(d.statuses.first).to eq(DomainStatus::CLIENT_DELETE_PROHIBITED)
|
||||
end
|
||||
|
||||
with_versioning do
|
||||
context 'when saved' do
|
||||
before(:each) do
|
||||
domain = create(:domain, nameservers_attributes: [attributes_for(:nameserver),
|
||||
attributes_for(:nameserver)])
|
||||
end
|
||||
|
||||
it 'creates domain version' do
|
||||
expect(DomainVersion.count).to eq(1)
|
||||
expect(ContactVersion.count).to eq(3)
|
||||
expect(NameserverVersion.count).to eq(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.describe Domain do
|
||||
|
|
|
@ -41,10 +41,6 @@ describe Keyrelay do
|
|||
"Only one parameter allowed: relative or absolute"
|
||||
])
|
||||
end
|
||||
|
||||
it 'should not have any versions' do
|
||||
@keyrelay.versions.should == []
|
||||
end
|
||||
end
|
||||
|
||||
context 'with valid attributes' do
|
||||
|
@ -63,16 +59,6 @@ describe Keyrelay do
|
|||
@keyrelay.errors.full_messages.should match_array([])
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
with_versioning do
|
||||
@keyrelay.versions.should == []
|
||||
@keyrelay.auth_info_pw = 'newpw'
|
||||
@keyrelay.save
|
||||
@keyrelay.errors.full_messages.should match_array([])
|
||||
@keyrelay.versions.size.should == 1
|
||||
end
|
||||
end
|
||||
|
||||
it 'is in pending status' do
|
||||
@keyrelay.status.should == 'pending'
|
||||
end
|
||||
|
|
|
@ -23,22 +23,6 @@ describe WhiteIp do
|
|||
end
|
||||
end
|
||||
|
||||
context 'with valid attributes' do
|
||||
before :all do
|
||||
@white_ip = create(:white_ip)
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
with_versioning do
|
||||
@white_ip.versions.should == []
|
||||
@white_ip.ipv4 = '192.168.1.2'
|
||||
@white_ip.save
|
||||
@white_ip.errors.full_messages.should match_array([])
|
||||
@white_ip.versions.size.should == 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#include_ip?' do
|
||||
context 'when given ip v4 exists' do
|
||||
before do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue