Skip to content

Commit

Permalink
Remove useless specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Beljajev committed May 17, 2019
1 parent 6bab335 commit 65a50a8
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 152 deletions.
8 changes: 0 additions & 8 deletions spec/models/account_spec.rb
Original file line number Diff line number Diff line change
@@ -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 }

Expand Down
10 changes: 0 additions & 10 deletions spec/models/admin_user_spec.rb
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
14 changes: 0 additions & 14 deletions spec/models/api_user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
])
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
Expand All @@ -41,16 +37,6 @@
@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
Expand Down
24 changes: 0 additions & 24 deletions spec/models/contact_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@
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
Expand All @@ -28,10 +18,6 @@
@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?
Expand Down Expand Up @@ -66,16 +52,6 @@
@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'
Expand Down
13 changes: 0 additions & 13 deletions spec/models/dnskey_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
@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
Expand Down Expand Up @@ -66,15 +62,6 @@
@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
Expand Down
34 changes: 0 additions & 34 deletions spec/models/domain_contact_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@
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
Expand All @@ -82,18 +70,6 @@
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
Expand All @@ -115,15 +91,5 @@
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
19 changes: 0 additions & 19 deletions spec/models/domain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
@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
Expand Down Expand Up @@ -489,21 +485,6 @@
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
Expand Down
14 changes: 0 additions & 14 deletions spec/models/keyrelay_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
"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
Expand All @@ -63,16 +59,6 @@
@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
Expand Down
16 changes: 0 additions & 16 deletions spec/models/white_ip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@
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
Expand Down

0 comments on commit 65a50a8

Please sign in to comment.