Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F461653
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 18, 10:29 AM
Size
870 B
Mime Type
text/x-diff
Expires
Tue, May 20, 10:29 AM (1 d, 15 h)
Engine
blob
Format
Raw Data
Handle
220384
Attached To
rWEBDNS WebDNS (edet4)
View Options
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
Event Timeline
Log In to Comment