mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Remove unneccessary country
This commit is contained in:
parent
b86e2d1edb
commit
62fa762627
7 changed files with 4 additions and 89 deletions
|
@ -52,3 +52,4 @@ class Admin::DomainsController < AdminController
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
Fabricator(:country) do
|
||||
iso 'EE'
|
||||
name 'Estonia'
|
||||
end
|
|
@ -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
|
||||
|
|
|
@ -3,6 +3,6 @@ Fabricator(:user) do
|
|||
password 'ghyt9e4fu'
|
||||
email 'info@gitlab.eu'
|
||||
identity_code '37810013108'
|
||||
country
|
||||
country_code 'EE'
|
||||
roles ['admin']
|
||||
end
|
||||
|
|
|
@ -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
|
|
@ -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) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue