mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-06 02:33:48 +00:00
added it_get_legal_page test
This commit is contained in:
@@ -174,14 +174,12 @@ class AppFunctionsController extends Controller
|
||||
/**
|
||||
* Get single page content
|
||||
*
|
||||
* @param $slug
|
||||
* @param Page $page
|
||||
* @return PageResource
|
||||
*/
|
||||
public function get_page($slug)
|
||||
public function get_page(Page $page)
|
||||
{
|
||||
return new PageResource(
|
||||
Page::where('slug', $slug)->first()
|
||||
);
|
||||
return new PageResource($page);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,7 @@ use App\Http\Controllers\Sharing\FileSharingController;
|
||||
|
||||
// Pages
|
||||
Route::post('/contact', [AppFunctionsController::class, 'contact_form']);
|
||||
Route::get('/page/{slug}', [AppFunctionsController::class, 'get_page']);
|
||||
Route::get('/page/{page}', [AppFunctionsController::class, 'get_page']);
|
||||
Route::get('/content', [AppFunctionsController::class, 'get_settings']);
|
||||
|
||||
// Stripe
|
||||
|
||||
@@ -36,6 +36,20 @@ class AppTest extends TestCase
|
||||
->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_get_legal_page()
|
||||
{
|
||||
$this->setup->seed_default_pages();
|
||||
|
||||
$this->getJson('/api/page/terms-of-service')
|
||||
->assertStatus(200)
|
||||
->assertJsonFragment([
|
||||
'title' => 'Terms of Service',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
@@ -44,7 +58,7 @@ class AppTest extends TestCase
|
||||
Mail::fake();
|
||||
|
||||
Setting::create([
|
||||
'name' => 'contact_email',
|
||||
'name' => 'contact_email',
|
||||
'value' => 'jane@doe.com',
|
||||
]);
|
||||
|
||||
@@ -54,6 +68,6 @@ class AppTest extends TestCase
|
||||
])
|
||||
->assertStatus(201);
|
||||
|
||||
Mail::assertSent( SendContactMessage::class);
|
||||
Mail::assertSent(SendContactMessage::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user