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

View File

@ -39,10 +39,10 @@ describe Micropub::Post do
_(post.title).must_equal "My great post"
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.title).must_equal "My money's in that office, right?"
assert_nil post.title
end
end