Files
sanasto-wiki/test/models/entry_test.rb
Runar Ingebrigtsen 530021960e
CI / scan_ruby (push) Failing after 12s
CI / scan_js (push) Successful in 11s
CI / lint (push) Failing after 19s
CI / test (push) Successful in 34s
add entry requests, invite new users
2026-01-30 01:28:53 +01:00

44 lines
960 B
Ruby

require "test_helper"
class EntryTest < ActiveSupport::TestCase
test "should be valid with a category and at least one translation" do
entry = Entry.new(category: :word, fi: "test")
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