Fix tests

This commit is contained in:
Daniel Supernault 2019-01-30 18:39:51 -07:00
parent 3a3f0e64c9
commit 13e1b51140
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
3 changed files with 15 additions and 16 deletions

View File

@ -40,7 +40,7 @@ SESSION_SECURE_COOKIE=true
API_BASE="/api/1/"
API_SEARCH="/api/search"
OPEN_REGISTRATION=true
OPEN_REGISTRATION=false
RECAPTCHA_ENABLED=false
ENFORCE_EMAIL_VERIFICATION=true

View File

@ -3,23 +3,23 @@
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
class InstalledTest extends TestCase
{
public function testLandingTest()
/** @test */
public function landing_page()
{
$response = $this->get('/');
$response
->assertStatus(200)
->assertSeeText('Image Sharing for Everyone');
$response->assertSeeText('Image Sharing for Everyone');
}
public function testNodeinfoTest()
/** @test */
public function nodeinfo_api()
{
$response = $this->get('/.well-known/nodeinfo');
$response
->assertStatus(200)
->assertJson([
$response->assertJson([
'links' => [
['rel' => 'http://nodeinfo.diaspora.software/ns/schema/2.0'],
], ]);

View File

@ -3,6 +3,8 @@
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
class LoginTest extends TestCase
{
@ -12,23 +14,20 @@ class LoginTest extends TestCase
{
$response = $this->get('login');
$response->assertSuccessful()
->assertSee('Forgot Your Password?');
$response->assertSee('Forgot Your Password?');
}
/** @test */
public function view_register_page()
{
if(true === config('pixelfed.open_registration')) {
if(true == config('pixelfed.open_registration')) {
$response = $this->get('register');
$response->assertSuccessful()
->assertSee('Register a new account');
$response->assertSee('Register a new account');
} else {
$response = $this->get('register');
$response->assertSuccessful()
->assertSee('Registration is closed');
$response->assertSee('Registration is closed');
}
}
}