Files
sanasto-wiki/test/models/entry_test.rb
2026-01-22 15:54:43 +01:00

44 lines
919 B
Ruby

require "test_helper"
class EntryTest < ActiveSupport::TestCase
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