feat: expose cms_type/WordPress credentials and published_url in API responses
This commit is contained in:
@@ -32,3 +32,17 @@ test('it shows a single site', function () {
|
||||
test('it returns 404 for a missing site', function () {
|
||||
$this->getJson('/api/sites/999')->assertNotFound();
|
||||
});
|
||||
|
||||
test('it includes WordPress fields in the site response', function () {
|
||||
$site = Site::factory()->wordpress()->create([
|
||||
'wp_username' => 'admin',
|
||||
'wp_app_password' => 'abcd 1234 efgh 5678',
|
||||
]);
|
||||
|
||||
$response = $this->getJson("/api/sites/{$site->id}");
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonPath('data.cms_type', 'wordpress')
|
||||
->assertJsonPath('data.wp_username', 'admin')
|
||||
->assertJsonPath('data.wp_app_password', 'abcd 1234 efgh 5678');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user