pp-planer/tests/Feature/ProPlaceholderTest.php

41 lines
1.2 KiB
PHP

<?php
use App\Models\Song;
use App\Models\User;
describe('Pro File Placeholder Endpoints', function () {
beforeEach(function () {
$this->user = User::factory()->create();
});
describe('GET /api/songs/{song}/download-pro', function () {
it('returns 501 Not Implemented with German error message', function () {
$song = Song::factory()->create();
$response = $this->actingAs($this->user)
->get("/api/songs/{$song->id}/download-pro");
$response->assertStatus(501);
$response->assertJson([
'message' => 'Der .pro-Parser wird später implementiert. Bitte warte auf die detaillierte Spezifikation.',
'error' => 'ProParserNotImplemented',
]);
});
it('requires authentication', function () {
$song = Song::factory()->create();
$response = $this->getJson("/api/songs/{$song->id}/download-pro");
$response->assertStatus(401);
});
it('returns 404 for non-existent song', function () {
$response = $this->actingAs($this->user)
->get('/api/songs/99999/download-pro');
$response->assertStatus(404);
});
});
});