mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
Add initial models and corresponding test files
This commit is contained in:
parent
bca4470643
commit
542ea5101e
28 changed files with 548 additions and 8 deletions
6
spec/models/address_spec.rb
Normal file
6
spec/models/address_spec.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe Address do
|
||||
it { should belong_to(:contact) }
|
||||
it { should belong_to(:country) }
|
||||
end
|
5
spec/models/contact_spec.rb
Normal file
5
spec/models/contact_spec.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe Contact do
|
||||
it { should have_many(:addresses) }
|
||||
end
|
14
spec/models/domain_spec.rb
Normal file
14
spec/models/domain_spec.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe Domain do
|
||||
it { should belong_to(:registrar) }
|
||||
it { should belong_to(:ns_set) }
|
||||
it { should belong_to(:admin_contact) }
|
||||
it { should belong_to(:owner_contact) }
|
||||
it { should belong_to(:technical_contact) }
|
||||
|
||||
it 'creates a resource' do
|
||||
d = Fabricate(:domain)
|
||||
expect(d.name).to_not be_nil
|
||||
end
|
||||
end
|
5
spec/models/nameserver_spec.rb
Normal file
5
spec/models/nameserver_spec.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe Nameserver do
|
||||
it { should have_and_belong_to_many(:ns_sets) }
|
||||
end
|
6
spec/models/ns_set_spec.rb
Normal file
6
spec/models/ns_set_spec.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe NsSet do
|
||||
it { should belong_to(:registrar)}
|
||||
it { should have_and_belong_to_many(:nameservers) }
|
||||
end
|
7
spec/models/registrar_spec.rb
Normal file
7
spec/models/registrar_spec.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe Registrar do
|
||||
it { should belong_to(:country) }
|
||||
it { should have_many(:domains) }
|
||||
it { should have_many(:ns_sets) }
|
||||
end
|
5
spec/models/right_spec.rb
Normal file
5
spec/models/right_spec.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe Right do
|
||||
it { should have_and_belong_to_many(:roles) }
|
||||
end
|
5
spec/models/role_spec.rb
Normal file
5
spec/models/role_spec.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe Role do
|
||||
it { should have_and_belong_to_many(:rights) }
|
||||
end
|
5
spec/models/user_spec.rb
Normal file
5
spec/models/user_spec.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require "rails_helper"
|
||||
|
||||
describe User do
|
||||
it { should belong_to(:role) }
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue