mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
Add setting route test
This commit is contained in:
parent
e5f77399fd
commit
2ca5047a9d
1 changed files with 15 additions and 1 deletions
|
@ -1,11 +1,13 @@
|
|||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
|
||||
class SettingTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
use DatabaseTransactions, WithoutMiddleware;
|
||||
|
||||
public function testSetSingleKeyValue()
|
||||
{
|
||||
|
@ -41,4 +43,16 @@ class SettingTest extends TestCase
|
|||
$this->assertEquals('bar', Setting::get('foo'));
|
||||
$this->assertEquals(['baz' => 'qux'], Setting::get('bar'));
|
||||
}
|
||||
|
||||
public function testApplicationSetting()
|
||||
{
|
||||
Media::shouldReceive('sync')->once();
|
||||
|
||||
$dir = dirname(__FILE__);
|
||||
$this->actingAs(factory(User::class, 'admin')->create())
|
||||
->post('/api/settings', ['media_path' => $dir])
|
||||
->seeStatusCode(200);
|
||||
|
||||
$this->assertEquals($dir, Setting::get('media_path'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue