mirror of
https://github.com/danbee/micropub.git
synced 2025-03-04 08:59:13 +00:00
Turns out title is passed as name (WTF?)
This commit is contained in:
parent
fc9698e745
commit
695825d230
@ -19,7 +19,7 @@ module Micropub
|
||||
end
|
||||
|
||||
def title
|
||||
params["title"]
|
||||
params["name"]
|
||||
end
|
||||
|
||||
def path
|
||||
|
||||
@ -6,7 +6,7 @@ module Micropub
|
||||
|
||||
def params
|
||||
{
|
||||
"title" => title,
|
||||
"name" => name,
|
||||
"content" => content,
|
||||
"category" => category,
|
||||
}.compact
|
||||
@ -16,8 +16,8 @@ module Micropub
|
||||
|
||||
attr_accessor :data
|
||||
|
||||
def title
|
||||
data.dig("properties", "title", 0)
|
||||
def name
|
||||
data.dig("properties", "name", 0)
|
||||
end
|
||||
|
||||
def content
|
||||
|
||||
@ -5,7 +5,7 @@ require "micropub/post"
|
||||
describe Micropub::Post do
|
||||
describe "#id" do
|
||||
it "parameterizes the title" do
|
||||
post = Micropub::Post.new("title" => "My amazing post")
|
||||
post = Micropub::Post.new("name" => "My amazing post")
|
||||
|
||||
_(post.id).must_equal "my-amazing-post"
|
||||
end
|
||||
@ -34,7 +34,7 @@ describe Micropub::Post do
|
||||
|
||||
describe "#title" do
|
||||
it "returns the title" do
|
||||
post = Micropub::Post.new("title" => "My great post")
|
||||
post = Micropub::Post.new("name" => "My great post")
|
||||
|
||||
_(post.title).must_equal "My great post"
|
||||
end
|
||||
@ -208,7 +208,7 @@ describe Micropub::Post do
|
||||
|
||||
it "returns a post formatted for hugo with a title" do
|
||||
post = Micropub::Post.new(
|
||||
"title" => "Welcome!",
|
||||
"name" => "Welcome!",
|
||||
"content" => "Hallo, Earth!",
|
||||
"published" => "2019-11-12",
|
||||
"category" => ["one", "two", "three"],
|
||||
@ -21,7 +21,7 @@ describe "create post" do
|
||||
|
||||
it "creates a post with a title" do
|
||||
post "/micropub/main", {
|
||||
title: "My money's in that office, right?",
|
||||
name: "My money's in that office, right?",
|
||||
content: <<~CONTENT,
|
||||
If she start giving me some bullshit about it ain"t there, and we got
|
||||
to go someplace else and get it, I"m gonna shoot you in the head then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user