add tests

This commit is contained in:
2026-01-22 15:54:43 +01:00
parent 5674e6b21a
commit 0de8e1ad14
10 changed files with 220 additions and 47 deletions
+39 -3
View File
@@ -1,7 +1,43 @@
require "test_helper"
class EntryTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
test "should be valid with a category" do
entry = Entry.new(category: :word)
assert entry.valid?
end
test "should be invalid without a category" do
entry = Entry.new(category: nil)
assert_not entry.valid?
end
test "can be a word" do
entry = Entry.new(category: :word)
assert entry.word?
end
test "can be a phrase" do
entry = Entry.new(category: :phrase)
assert entry.phrase?
end
test "can be a proper_name" do
entry = Entry.new(category: :proper_name)
assert entry.proper_name?
end
test "can be a title" do
entry = Entry.new(category: :title)
assert entry.title?
end
test "can be a reference" do
entry = Entry.new(category: :reference)
assert entry.reference?
end
test "can be other" do
entry = Entry.new(category: :other)
assert entry.other?
end
end