diff --git a/app/Http/Controllers/MicropubClientController.php b/app/Http/Controllers/MicropubClientController.php index 25336aa1..dacfc91a 100644 --- a/app/Http/Controllers/MicropubClientController.php +++ b/app/Http/Controllers/MicropubClientController.php @@ -54,6 +54,7 @@ class MicropubClientController extends Controller */ public function store(Request $request) { + Log::info('posting new note'); $domain = $request->session()->get('me'); $token = $request->session()->get('token'); @@ -62,12 +63,14 @@ class MicropubClientController extends Controller $this->indieClient ); if (! $micropubEndpoint) { + Log::error('no known endpoint to post to'); return redirect(route('micropub-client'))->withErrors('Unable to determine micropub API endpoint', 'endpoint'); } $response = $this->postNoteRequest($request, $micropubEndpoint, $token); if ($response->getStatusCode() == 201) { + Log::info('redirecting to note'); $location = $response->getHeader('Location'); if (is_array($location)) { return redirect($location[0]); @@ -75,7 +78,7 @@ class MicropubClientController extends Controller return redirect($location); } - + Log::error('note not created'); return redirect(route('micropub-client'))->withErrors('Endpoint didn’t create the note.', 'endpoint'); } diff --git a/tests/Browser/MicropubClientTest.php b/tests/Browser/MicropubClientTest.php index 310d7ede..757ec0f5 100644 --- a/tests/Browser/MicropubClientTest.php +++ b/tests/Browser/MicropubClientTest.php @@ -25,7 +25,7 @@ class MicropubClientTest extends DuskTestCase $faker = \Faker\Factory::create(); $note = $faker->text; $this->browse(function ($browser) use ($note) { - $browser->visit('/micropub/create') + $browser->visit(route('micropub-client')) ->type('textarea[name="content"]', $note) ->press('submit'); sleep(2);