Fix tests

This commit is contained in:
Jonny Barnes 2017-02-16 15:42:44 +00:00
parent b8c0724036
commit 0ca17f2d0a
3 changed files with 9 additions and 9 deletions

View file

@ -166,7 +166,7 @@ class MicropubController extends Controller
return response()->json([ return response()->json([
'response' => 'error', 'response' => 'error',
'error' => 'no_token', 'error' => 'no_token',
'error_description' 'error_description' => 'No token provided with request'
], 400); ], 400);
} }
} }

View file

@ -52,24 +52,24 @@ class IndieAuthTest extends BrowserKitTest
} }
/** /**
* Test the `beginauth` method redirects to the client on error. * Test the `start` method redirects to the client on error.
* *
* @return void * @return void
*/ */
public function testIndieAuthControllerBeginAuthRedirectsToClientOnFail() public function testIndieAuthControllerBeginAuthRedirectsToClientOnFail()
{ {
$response = $this->call('GET', $this->appurl . '/beginauth', ['me' => 'http://example.org']); $response = $this->call('GET', $this->appurl . '/indieauth/start', ['me' => 'http://example.org']);
$this->assertSame($this->appurl . '/notes/new', $response->headers->get('Location')); $this->assertSame($this->appurl . '/micropub/create', $response->headers->get('Location'));
} }
/** /**
* Now we test the `beginauth` method as a whole. * Now we test the `start` method as a whole.
* *
* @return void * @return void
*/ */
public function testIndieAuthControllerBeginAuthRedirectsToEndpoint() public function testIndieAuthControllerBeginAuthRedirectsToEndpoint()
{ {
$response = $this->call('GET', $this->appurl . '/beginauth', ['me' => $this->appurl]); $response = $this->call('GET', $this->appurl . '/indieauth/start', ['me' => $this->appurl]);
$this->assertSame( $this->assertSame(
'https://indieauth.com/auth?me=', 'https://indieauth.com/auth?me=',
substr($response->headers->get('Location'), 0, 30) substr($response->headers->get('Location'), 0, 30)

View file

@ -26,13 +26,13 @@ class MicropubClientTest extends BrowserKitTest
*/ */
public function testClientPageUnauthorised() public function testClientPageUnauthorised()
{ {
$this->visit($this->appurl . '/notes/new') $this->visit($this->appurl . '/micropub/create')
->see('IndieAuth'); ->see('IndieAuth');
} }
public function testClientPageRecentAuth() public function testClientPageRecentAuth()
{ {
$this->visit($this->appurl . '/notes/new') $this->visit($this->appurl . '/micropub/create')
->see($this->appurl); ->see($this->appurl);
} }
@ -41,7 +41,7 @@ class MicropubClientTest extends BrowserKitTest
//in this test, the syndication targets are blank //in this test, the syndication targets are blank
$faker = \Faker\Factory::create(); $faker = \Faker\Factory::create();
$note = 'Fake note from #PHPUnit: ' . $faker->text; $note = 'Fake note from #PHPUnit: ' . $faker->text;
$this->visit($this->appurl . '/notes/new') $this->visit($this->appurl . '/micropub/create')
->type($note, 'content') ->type($note, 'content')
->press('Submit'); ->press('Submit');
$this->seeInDatabase('notes', ['note' => $note]); $this->seeInDatabase('notes', ['note' => $note]);