Point the public site to each project's TaskStream board
A project with a board now carries its key, its address and the address of the board's public showcase in the public API, so the website can show its roadmap, releases and tickets for newcomers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Models\Member;
|
||||
use App\Models\Project;
|
||||
use App\Models\Repository;
|
||||
use App\Models\Technology;
|
||||
use App\Services\TaskStream\TaskStreamClient;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use Tests\TestCase;
|
||||
@@ -63,6 +64,32 @@ class PublicApiTest extends TestCase
|
||||
$this->getJson('/api/public/v1/projects/el-meu-projecte')->assertNotFound();
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function it_points_to_the_board_in_taskstream_when_there_is_one(): void
|
||||
{
|
||||
config([
|
||||
'services.taskstream.api_url' => 'https://api.taskstream.test',
|
||||
'services.taskstream.web_url' => 'https://taskstream.test',
|
||||
]);
|
||||
$this->app->forgetInstance(TaskStreamClient::class);
|
||||
Project::factory()->published()->create([
|
||||
'slug' => ['es' => 'con-tablero'],
|
||||
'taskstream_key' => 'WEB',
|
||||
]);
|
||||
Project::factory()->published()->create(['slug' => ['es' => 'sin-tablero']]);
|
||||
|
||||
$this->getJson('/api/public/v1/projects/con-tablero')
|
||||
->assertOk()
|
||||
->assertJsonPath('data.taskstream', [
|
||||
'key' => 'WEB',
|
||||
'url' => 'https://taskstream.test/p/WEB',
|
||||
'web_url' => 'https://taskstream.test',
|
||||
'showcase_url' => 'https://api.taskstream.test/api/explore/projects/WEB/showcase',
|
||||
]);
|
||||
$this->getJson('/api/public/v1/projects/sin-tablero')
|
||||
->assertJsonPath('data.taskstream', null);
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function it_returns_hreflang_alternates_for_every_translated_locale(): void
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user