mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 00:02:15 +00:00
added it_get_settings, it_try_get_secured_settings_via_public_api test
This commit is contained in:
@@ -4,12 +4,8 @@ namespace Tests\Feature\App;
|
||||
|
||||
use App\Http\Mail\SendContactMessage;
|
||||
use App\Models\Setting;
|
||||
use App\Notifications\SharedSendViaEmail;
|
||||
use App\Services\SetupService;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Mail;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -70,4 +66,41 @@ class AppTest extends TestCase
|
||||
|
||||
Mail::assertSent(SendContactMessage::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_settings()
|
||||
{
|
||||
Setting::create([
|
||||
'name' => 'get_started_title',
|
||||
'value' => 'Hello World!',
|
||||
]);
|
||||
|
||||
Setting::create([
|
||||
'name' => 'pricing_description',
|
||||
'value' => 'Give me a money!',
|
||||
]);
|
||||
|
||||
$this->getJson('/api/content?column=get_started_title|pricing_description')
|
||||
->assertStatus(200)
|
||||
->assertExactJson([
|
||||
"get_started_title" => "Hello World!",
|
||||
"pricing_description" => "Give me a money!",
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_try_get_secured_settings_via_public_api()
|
||||
{
|
||||
Setting::create([
|
||||
'name' => 'purchase_code',
|
||||
'value' => '15a53561-d387-4e0a-8de1-5d1bff34c1ed',
|
||||
]);
|
||||
|
||||
$this->getJson('/api/content?column=purchase_code')
|
||||
->assertStatus(401);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user