This commit is contained in:
13
test/models/leaf_test.rb
Normal file
13
test/models/leaf_test.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
require "test_helper"
|
||||
|
||||
class LeafTest < ActiveSupport::TestCase
|
||||
test "slug is generated from title" do
|
||||
leaf = Leaf.new(title: "Hello, World!")
|
||||
assert_equal "hello-world", leaf.slug
|
||||
end
|
||||
|
||||
test "slug is never completely blank" do
|
||||
leaf = Leaf.new(title: "")
|
||||
assert_equal "-", leaf.slug
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user