Incentive (E1): Recruiting Challenge mit finalen Texten als Seeder, Abstimmungsvorlage aktualisiert
Seeder legt die Challenge als Entwurf mit Beschreibung, Bedingungen und den Werten 50 EUR je Neupartner sowie 500/300/200 EUR Bonus an; ein zweiter Lauf aktualisiert nur die Texte. Vorlage ohne Gedankenstriche, Bonus entschieden, offene Regelfragen mit den in den Bedingungen hinterlegten Vorschlaegen. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
1f55e2c966
commit
4e4b58e90e
3 changed files with 234 additions and 111 deletions
46
tests/Feature/Incentive/RecruitingChallengeSeederTest.php
Normal file
46
tests/Feature/Incentive/RecruitingChallengeSeederTest.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Incentive;
|
||||
use Database\Seeders\RecruitingChallenge2026Seeder;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
/**
|
||||
* E1: Der Seeder legt die Recruiting Challenge mit den abgestimmten Texten als Entwurf an
|
||||
* und ueberschreibt bei einem zweiten Lauf nur die Texte, nicht die Admin-Werte.
|
||||
*/
|
||||
it('legt die Challenge als Entwurf mit Praemie und Wertung nach Neupartnern an', function () {
|
||||
$this->seed(RecruitingChallenge2026Seeder::class);
|
||||
|
||||
$incentive = Incentive::where('slug', RecruitingChallenge2026Seeder::SLUG)->firstOrFail();
|
||||
|
||||
expect($incentive->isDraft())->toBeTrue()
|
||||
->and($incentive->name)->toBe('Recruiting Challenge 2026/27')
|
||||
->and($incentive->qualification_start->toDateString())->toBe('2026-10-01')
|
||||
->and($incentive->qualification_end->toDateString())->toBe('2027-01-31')
|
||||
->and((float) $incentive->amount_per_partner)->toBe(50.0)
|
||||
->and($incentive->rankBonuses())->toBe([1 => 500.0, 2 => 300.0, 3 => 200.0])
|
||||
->and($incentive->max_winners)->toBe(3)
|
||||
->and($incentive->ranksByPartnerCount())->toBeTrue()
|
||||
->and($incentive->hasMinimumRequirements())->toBeFalse()
|
||||
->and($incentive->description)->toContain('50 €')
|
||||
->and($incentive->terms)->toContain('6. Gleichstand')
|
||||
->and($incentive->description.$incentive->subtitle.$incentive->terms)->not->toContain('–')
|
||||
->and($incentive->description.$incentive->subtitle.$incentive->terms)->not->toContain('—');
|
||||
});
|
||||
|
||||
it('aktualisiert beim zweiten Lauf nur die Texte und laesst Admin-Werte stehen', function () {
|
||||
$this->seed(RecruitingChallenge2026Seeder::class);
|
||||
$incentive = Incentive::where('slug', RecruitingChallenge2026Seeder::SLUG)->firstOrFail();
|
||||
$incentive->update(['status' => 1, 'image' => 'challenge.jpg', 'bonus_rank_1' => 999, 'description' => 'alt']);
|
||||
|
||||
$this->seed(RecruitingChallenge2026Seeder::class);
|
||||
|
||||
$incentive->refresh();
|
||||
expect(Incentive::where('slug', RecruitingChallenge2026Seeder::SLUG)->count())->toBe(1)
|
||||
->and($incentive->status)->toBe(1)
|
||||
->and($incentive->image)->toBe('challenge.jpg')
|
||||
->and((float) $incentive->bonus_rank_1)->toBe(999.0)
|
||||
->and($incentive->description)->toContain('50 €');
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue