Remove useless specs

This commit is contained in:
Artur Beljajev 2019-04-03 20:25:40 +03:00
parent 6bab335f5a
commit 65a50a8db0
9 changed files with 0 additions and 152 deletions

View file

@ -1,14 +1,6 @@
require 'rails_helper' require 'rails_helper'
RSpec.describe Account do 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 describe 'registrar validation', db: false do
subject(:account) { described_class.new } subject(:account) { described_class.new }

View file

@ -1,16 +1,6 @@
require 'rails_helper' require 'rails_helper'
RSpec.describe AdminUser do 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 context 'with valid attributes' do
before do before do
@admin_user = create(:admin_user) @admin_user = create(:admin_user)

View file

@ -17,10 +17,6 @@ RSpec.describe ApiUser do
]) ])
end end
it 'should not have any versions' do
@api_user.versions.should == []
end
it 'should be active by default' do it 'should be active by default' do
@api_user.active.should == true @api_user.active.should == true
end end
@ -41,16 +37,6 @@ RSpec.describe ApiUser do
@api_user.valid? @api_user.valid?
@api_user.errors.full_messages.should match_array([]) @api_user.errors.full_messages.should match_array([])
end 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 end
describe '::min_password_length', db: false do describe '::min_password_length', db: false do

View file

@ -5,16 +5,6 @@ RSpec.describe Contact do
create(:zone, origin: 'ee') create(:zone, origin: 'ee')
end 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 context 'with invalid attribute' do
before :example do before :example do
@contact = Contact.new @contact = Contact.new
@ -28,10 +18,6 @@ RSpec.describe Contact do
@contact.updator.should == nil @contact.updator.should == nil
end end
it 'should not have any versions' do
@contact.versions.should == []
end
it 'should not accept long code' do it 'should not accept long code' do
@contact.code = 'verylongcode' * 100 @contact.code = 'verylongcode' * 100
@contact.valid? @contact.valid?
@ -66,16 +52,6 @@ RSpec.describe Contact do
@contact = create(:contact) @contact = create(:contact)
end 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 it 'should not overwrite code' do
old_code = @contact.code old_code = @contact.code
@contact.code = 'CID:REG1:should-not-overwrite-old-code-12345' @contact.code = 'CID:REG1:should-not-overwrite-old-code-12345'

View file

@ -34,10 +34,6 @@ describe Dnskey do
@dnskey.errors.full_messages.should match_array([ @dnskey.errors.full_messages.should match_array([
]) ])
end end
it 'should not have any versions' do
@dnskey.versions.should == []
end
end end
context 'with valid attributes' do context 'with valid attributes' do
@ -66,15 +62,6 @@ describe Dnskey do
@dnskey.errors.full_messages.should match_array([]) @dnskey.errors.full_messages.should match_array([])
end 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 it 'generates correct DS digest and DS key tag for ria.ee' do
d = create(:domain, name: 'ria.ee', dnskeys: [@dnskey]) d = create(:domain, name: 'ria.ee', dnskeys: [@dnskey])
dk = d.dnskeys.last dk = d.dnskeys.last

View file

@ -49,18 +49,6 @@ describe DomainContact do
it 'should have Tech name' do it 'should have Tech name' do
@domain_contact.name.should == 'Tech' @domain_contact.name.should == 'Tech'
end 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 end
context 'with valid attributes with tech domain contact' do context 'with valid attributes with tech domain contact' do
@ -82,18 +70,6 @@ describe DomainContact do
it 'should have Tech name' do it 'should have Tech name' do
@domain_contact.name.should == 'Tech' @domain_contact.name.should == 'Tech'
end 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 end
context 'with valid attributes with admin domain contact' do context 'with valid attributes with admin domain contact' do
@ -115,15 +91,5 @@ describe DomainContact do
it 'should have Tech name' do it 'should have Tech name' do
@domain_contact.name.should == 'Admin' @domain_contact.name.should == 'Admin'
end 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
end end

View file

@ -33,10 +33,6 @@ RSpec.describe Domain do
@domain = Domain.new @domain = Domain.new
end end
it 'should not have any versions' do
@domain.versions.should == []
end
it 'should not have whois body' do it 'should not have whois body' do
@domain.whois_record.should == nil @domain.whois_record.should == nil
end end
@ -489,21 +485,6 @@ RSpec.describe Domain do
expect(d.statuses.count).to eq(1) expect(d.statuses.count).to eq(1)
expect(d.statuses.first).to eq(DomainStatus::CLIENT_DELETE_PROHIBITED) expect(d.statuses.first).to eq(DomainStatus::CLIENT_DELETE_PROHIBITED)
end 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 end
RSpec.describe Domain do RSpec.describe Domain do

View file

@ -41,10 +41,6 @@ describe Keyrelay do
"Only one parameter allowed: relative or absolute" "Only one parameter allowed: relative or absolute"
]) ])
end end
it 'should not have any versions' do
@keyrelay.versions.should == []
end
end end
context 'with valid attributes' do context 'with valid attributes' do
@ -63,16 +59,6 @@ describe Keyrelay do
@keyrelay.errors.full_messages.should match_array([]) @keyrelay.errors.full_messages.should match_array([])
end 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 it 'is in pending status' do
@keyrelay.status.should == 'pending' @keyrelay.status.should == 'pending'
end end

View file

@ -23,22 +23,6 @@ describe WhiteIp do
end end
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 describe '#include_ip?' do
context 'when given ip v4 exists' do context 'when given ip v4 exists' do
before do before do