tabletop-companion/test/models/table_test.rb

21 lines
410 B
Ruby

# frozen_string_literal: true
require "test_helper"
class TableTest < ActiveSupport::TestCase
test "name must exist" do
assert_must_exist(tables(:table), "name")
end
test "slug must exist" do
assert_must_exist(tables(:table), "slug")
end
test "slug must be unique" do
table1 = Table.first
table2 = Table.second
table1.slug = table2.slug
assert_not table1.valid?
end
end