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:
parent
10d6626e58
commit
37fe32f291
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user