require "test_helper"

class SupportedLanguageTest < ActiveSupport::TestCase
  test "should be valid with all attributes" do
    language = SupportedLanguage.new(code: "sv", name: "Swedish", native_name: "Svenska")
    assert language.valid?
  end

  test "should be invalid with a duplicate code" do
    language = SupportedLanguage.new(code: supported_languages(:one).code, name: "English", native_name: "English")
    assert_not language.valid?
  end
end
