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
+10 -3
View File
@@ -1,7 +1,14 @@
require "test_helper"
class SupportedLanguageTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
test "should be valid with all attributes" do
language = SupportedLanguage.new(code: "es", name: "Spanish", native_name: "Español")
assert language.valid?
end
test "should be invalid with a duplicate code" do
SupportedLanguage.create(code: "de", name: "German", native_name: "Deutsch")
language = SupportedLanguage.new(code: "de", name: "German", native_name: "Deutsch")
assert_not language.valid?
end
end