koel/tests/Feature/SettingTest.php
2017-08-05 19:55:02 +01:00

25 lines
581 B
PHP

<?php
namespace Tests\Feature;
use App\Models\Setting;
use App\Models\User;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Media;
class SettingTest extends TestCase
{
use WithoutMiddleware;
/** @test */
public function application_setting_is_saved_properly()
{
Media::shouldReceive('sync')->once();
$user = factory(User::class, 'admin')->create();
$this->postAsUser('/api/settings', ['media_path' => __DIR__], $user)
->seeStatusCode(200);
$this->assertEquals(__DIR__, Setting::get('media_path'));
}
}