From 2dac20c0b4fbbc80e04a67aa58f58d6c6a188479 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Tue, 16 Aug 2022 22:10:44 -0500 Subject: [PATCH] Remove `/main` --- lib/micropub/webserver.rb | 4 ++-- test/requests/auth_test.rb | 6 +++--- test/requests/create_post_test.rb | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/micropub/webserver.rb b/lib/micropub/webserver.rb index e838205..d5cb34c 100644 --- a/lib/micropub/webserver.rb +++ b/lib/micropub/webserver.rb @@ -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) diff --git a/test/requests/auth_test.rb b/test/requests/auth_test.rb index 2f7a1e6..07f3a4d 100644 --- a/test/requests/auth_test.rb +++ b/test/requests/auth_test.rb @@ -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!" } diff --git a/test/requests/create_post_test.rb b/test/requests/create_post_test.rb index 9453665..d0271b1 100644 --- a/test/requests/create_post_test.rb +++ b/test/requests/create_post_test.rb @@ -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?