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
