From 62fa762627ff67d709dad7a3adb304e11ad44983 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Mon, 2 Feb 2015 12:53:16 +0200 Subject: [PATCH] Remove unneccessary country --- app/controllers/admin/domains_controller.rb | 1 + app/models/nameserver.rb | 2 +- spec/fabricators/country_fabricator.rb | 4 - spec/fabricators/registrar_fabricator.rb | 2 +- spec/fabricators/user_fabricator.rb | 2 +- spec/models/country_spec.rb | 81 --------------------- spec/models/registrar_spec.rb | 1 - 7 files changed, 4 insertions(+), 89 deletions(-) delete mode 100644 spec/fabricators/country_fabricator.rb delete mode 100644 spec/models/country_spec.rb diff --git a/app/controllers/admin/domains_controller.rb b/app/controllers/admin/domains_controller.rb index 7b6cbe511..9bd1b86ac 100644 --- a/app/controllers/admin/domains_controller.rb +++ b/app/controllers/admin/domains_controller.rb @@ -52,3 +52,4 @@ class Admin::DomainsController < AdminController end end end + diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb index 76e287577..fd4747563 100644 --- a/app/models/nameserver.rb +++ b/app/models/nameserver.rb @@ -2,7 +2,7 @@ class Nameserver < ActiveRecord::Base include Versions # version/nameserver_version.rb include EppErrors - belongs_to :registrar + # belongs_to :registrar belongs_to :domain # rubocop: disable Metrics/LineLength diff --git a/spec/fabricators/country_fabricator.rb b/spec/fabricators/country_fabricator.rb deleted file mode 100644 index d96c50f96..000000000 --- a/spec/fabricators/country_fabricator.rb +++ /dev/null @@ -1,4 +0,0 @@ -Fabricator(:country) do - iso 'EE' - name 'Estonia' -end diff --git a/spec/fabricators/registrar_fabricator.rb b/spec/fabricators/registrar_fabricator.rb index 38c6704f2..9d8ca14c5 100644 --- a/spec/fabricators/registrar_fabricator.rb +++ b/spec/fabricators/registrar_fabricator.rb @@ -3,5 +3,5 @@ Fabricator(:registrar) do reg_no '12345678' address 'Street 999, Town, County, Postal' email 'info@registrar1.ee' - country + country_code 'EE' end diff --git a/spec/fabricators/user_fabricator.rb b/spec/fabricators/user_fabricator.rb index d3635dfbb..a3876eeef 100644 --- a/spec/fabricators/user_fabricator.rb +++ b/spec/fabricators/user_fabricator.rb @@ -3,6 +3,6 @@ Fabricator(:user) do password 'ghyt9e4fu' email 'info@gitlab.eu' identity_code '37810013108' - country + country_code 'EE' roles ['admin'] end diff --git a/spec/models/country_spec.rb b/spec/models/country_spec.rb deleted file mode 100644 index 44d0437bd..000000000 --- a/spec/models/country_spec.rb +++ /dev/null @@ -1,81 +0,0 @@ -require 'rails_helper' - -describe Country do - context 'about class' do - it 'should have versioning enabled?' do - Country.paper_trail_enabled_for_model?.should == true - end - - it 'should have custom log prexied table name for versions table' do - CountryVersion.table_name.should == 'log_countries' - end - end - - context 'with invalid attribute' do - before :all do - @country = Country.new - end - - it 'should not be valid' do - @country.valid? - @country.errors.full_messages.should match_array([ - "Name is missing" - ]) - end - - it 'should not have any versions' do - @country.versions.should == [] - end - - it 'should not have any creator' do - @country.creator_str.should == nil - end - - it 'should not have any updater' do - @country.updator_str.should == nil - end - end - - context 'with valid attributes' do - before :all do - @country = Fabricate(:country) - end - - it 'should be valid' do - @country.valid? - @country.errors.full_messages.should match_array([]) - end - - it 'should not have a version' do - with_versioning do - @country.versions.should == [] - @country.name = 'New name' - @country.save - @country.versions.size.should == 1 - end - end - - it 'should have creator' do - PaperTrail.whodunnit = 'test-user' - - with_versioning do - @country = Fabricate(:country) - @country.name = 'Updated name' - @country.save - @country.creator_str.should == 'test-user' - @country.updator_str.should == 'test-user' - end - end - - it 'should have creator' do - PaperTrail.whodunnit = 'test-user-2' - - with_versioning do - @country.name = 'Updated name' - @country.save - @country.updator_str.should == 'test-user-2' - @country.creator_str.should == nil # Factory does not have it - end - end - end -end diff --git a/spec/models/registrar_spec.rb b/spec/models/registrar_spec.rb index 723dfda82..c97207291 100644 --- a/spec/models/registrar_spec.rb +++ b/spec/models/registrar_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe Registrar do - it { should belong_to(:country) } it { should have_many(:domains) } it { should have_many(:api_users) } it { should have_many(:messages) }