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

Remove /main

This commit is contained in:
Daniel Barber 2022-08-16 22:10:44 -05:00
parent 0827022bf0
commit 2dac20c0b4
3 changed files with 11 additions and 11 deletions

View File

@ -19,14 +19,14 @@ module Micropub
json request.env
end
get "/micropub/main" do
get "/micropub" do
json data: {
posts: github.posts,
photos: github.photos,
}
end
post "/micropub/main" do
post "/micropub" do
if valid_token?
post = Post.new(post_params)

View File

@ -13,7 +13,7 @@ describe "auth" do
end
it "rejects authentication without a token" do
post "/micropub/main", {
post "/micropub", {
content: "Hello, World!"
}
@ -22,7 +22,7 @@ describe "auth" do
it "authenticates with a header" do
header "Authorization", "Bearer #{@auth_token}"
post "/micropub/main", {
post "/micropub", {
content: "Hello, World!"
}
@ -30,7 +30,7 @@ describe "auth" do
end
it "authenticates with a form param" do
post "/micropub/main", {
post "/micropub", {
access_token: @auth_token,
content: "Hello, World!"
}

View File

@ -9,7 +9,7 @@ describe "create post" do
end
it "creates a simple post" do
post "/micropub/main", {
post "/micropub", {
content: "Hello, World!"
}
@ -20,7 +20,7 @@ describe "create post" do
end
it "creates a post with a title" do
post "/micropub/main", {
post "/micropub", {
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
@ -37,7 +37,7 @@ describe "create post" do
end
it "creates a post with a single category" do
post "/micropub/main", {
post "/micropub", {
content: "Hello, World!",
category: "my-blog",
}
@ -49,7 +49,7 @@ describe "create post" do
end
it "creates a post with multiple categories" do
post "/micropub/main", {
post "/micropub", {
content: "Hello, World!",
category: ["one", "two", "three"],
}
@ -69,7 +69,7 @@ describe "create post" do
},
}.to_json
post "/micropub/main", post_json, { "CONTENT_TYPE" => "application/json" }
post "/micropub", post_json, { "CONTENT_TYPE" => "application/json" }
date = Time.now.strftime("%Y/%m/%d")
assert last_response.accepted?
@ -86,7 +86,7 @@ describe "create post" do
},
}.to_json
post "/micropub/main", post_json, { "CONTENT_TYPE" => "application/json" }
post "/micropub", post_json, { "CONTENT_TYPE" => "application/json" }
date = Time.now.strftime("%Y/%m/%d")
assert last_response.accepted?