1
0
mirror of https://github.com/danbee/micropub.git synced 2025-03-04 08:59:13 +00:00

Title should not be truncated content

This commit is contained in:
Daniel Barber 2019-11-17 17:02:48 -05:00
parent 10d6626e58
commit 37fe32f291
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
2 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ module Micropub
end end
def id def id
title. (title || truncated_content).
downcase. downcase.
gsub(/[^a-z]+/, " "). gsub(/[^a-z]+/, " ").
strip. strip.
@ -18,7 +18,7 @@ module Micropub
end end
def title def title
params["title"] || truncated_content params["title"]
end end
def path def path

View File

@ -39,10 +39,10 @@ describe Micropub::Post do
_(post.title).must_equal "My great post" _(post.title).must_equal "My great post"
end end
it "returns the content if there's no title" do it "returns nil if there's no title" do
post = Micropub::Post.new("content" => "My money's in that office, right?") post = Micropub::Post.new("content" => "My money's in that office, right?")
_(post.title).must_equal "My money's in that office, right?" assert_nil post.title
end end
end end