require "test_helper"

class SupportedLanguageTest < ActiveSupport::TestCase
  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
