diff --git a/app/models/ns.rb b/app/models/ns.rb new file mode 100644 index 0000000..f620e5b --- /dev/null +++ b/app/models/ns.rb @@ -0,0 +1,4 @@ +class NS < Record + validates :content, presence: true, hostname: true +end + diff --git a/test/factories/ns.rb b/test/factories/ns.rb new file mode 100644 index 0000000..3d30273 --- /dev/null +++ b/test/factories/ns.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :ns, class: NS do + domain + name '' + content { generate(:domain) } + end +end diff --git a/test/models/ns_test.rb b/test/models/ns_test.rb new file mode 100644 index 0000000..a099692 --- /dev/null +++ b/test/models/ns_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class NSTest < ActiveSupport::TestCase + setup do + @record = build(:ns) + end + + test 'save' do + @record.save + + assert_empty @record.errors + end + +end