10.April 2026
This commit is contained in:
parent
a00c42e770
commit
f58c709945
208 changed files with 19280 additions and 2914 deletions
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Incentive;
|
||||
use App\Models\IncentiveParticipant;
|
||||
use App\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
it('markiert Teilnehmer ohne Teilnahmebestaetigung als nicht oeffentlich (hasAcceptedTerms)', function () {
|
||||
$incentive = Incentive::factory()->create();
|
||||
|
||||
$userA = User::forceCreate([
|
||||
'email' => 'a-'.uniqid('', true).'@example.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'lang' => 'de',
|
||||
]);
|
||||
$userB = User::forceCreate([
|
||||
'email' => 'b-'.uniqid('', true).'@example.com',
|
||||
'password' => bcrypt('secret'),
|
||||
'lang' => 'de',
|
||||
]);
|
||||
|
||||
$anonymous = IncentiveParticipant::factory()->unconfirmed()->create([
|
||||
'incentive_id' => $incentive->id,
|
||||
'user_id' => $userA->id,
|
||||
]);
|
||||
|
||||
$confirmed = IncentiveParticipant::factory()->create([
|
||||
'incentive_id' => $incentive->id,
|
||||
'user_id' => $userB->id,
|
||||
'accepted_terms_at' => now(),
|
||||
]);
|
||||
|
||||
expect($anonymous->hasAcceptedTerms())->toBeFalse()
|
||||
->and($confirmed->hasAcceptedTerms())->toBeTrue();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue