Daniel Supernault пре 6 година
родитељ
комит
13e1b51140
3 измењених фајлова са 15 додато и 16 уклоњено
  1. 1 1
      .env.testing
  2. 8 8
      tests/Feature/InstalledTest.php
  3. 6 7
      tests/Feature/LoginTest.php

+ 1 - 1
.env.testing

@@ -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
 

+ 8 - 8
tests/Feature/InstalledTest.php

@@ -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'],
           ], ]);

+ 6 - 7
tests/Feature/LoginTest.php

@@ -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');
         }
     }
 }