From 435e1d5d64f4bcba08ed62b7650edd7ba2a3a28c Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Thu, 25 Jan 2018 12:46:53 +0200 Subject: [PATCH] Remove old specs #660 --- spec/models/contact_spec.rb | 42 +++---------------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/spec/models/contact_spec.rb b/spec/models/contact_spec.rb index b9be3b3fa..1703bf90a 100644 --- a/spec/models/contact_spec.rb +++ b/spec/models/contact_spec.rb @@ -63,7 +63,7 @@ RSpec.describe Contact do context 'with valid attributes' do before :example do - @contact = create(:contact, auth_info: 'password') + @contact = create(:contact) end it 'should have one version' do @@ -87,10 +87,6 @@ RSpec.describe Contact do @contact.code.should == old_code end - it 'should have static password' do - @contact.auth_info.should == 'password' - end - it 'should have ok status by default' do @contact.statuses.should == %w(ok) end @@ -177,25 +173,16 @@ RSpec.describe Contact do create(:contact, registrar: registrar, - code: 'FIXED:new-code', - auth_info: 'qwe321') + code: 'FIXED:new-code') @contact = build(:contact, registrar: registrar, - code: 'FIXED:new-code', - auth_info: 'qwe321') + code: 'FIXED:new-code') @contact.validate expect(@contact.errors).to have_key(:code) end - it 'should generate a new password' do - @contact = build(:contact, code: '123asd', auth_info: nil) - @contact.auth_info.should == nil - @contact.save.should == true - @contact.auth_info.should_not be_nil - end - it 'should allow supported code format' do @contact = build(:contact, code: 'CID:REG1:12345', registrar: create(:registrar, code: 'FIXED')) @contact.valid? @@ -222,29 +209,6 @@ RSpec.describe Contact do @contact.code.should =~ /FIXED:..../ end end - - context 'after update' do - before :example do - @contact = build(:contact, - registrar: create(:registrar, code: 'FIXED'), - code: '123asd', - auth_info: 'qwe321') - @contact.generate_code - @contact.save - @contact.code.should == 'FIXED:123ASD' - @auth_info = @contact.auth_info - end - - it 'should not generate new code' do - @contact.update_attributes(name: 'qevciherot23') - @contact.code.should == 'FIXED:123ASD' - end - - it 'should not generate new auth_info' do - @contact.update_attributes(name: 'fvrsgbqevciherot23') - @contact.auth_info.should == @auth_info - end - end end end end