Implement enum for audition flags
This commit is contained in:
parent
9b381ebbbc
commit
749af22aad
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
enum AuditionFlags: string
|
||||||
|
{
|
||||||
|
case DRAWN = 'drawn';
|
||||||
|
case SEATS_PUBLISHED = 'seats_published';
|
||||||
|
case ADVANCEMENT_PUBLISHED = 'advancement_published';
|
||||||
|
}
|
||||||
|
|
@ -5,12 +5,10 @@ namespace App\Http\Controllers;
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use App\Models\JudgeAdvancementVote;
|
use App\Models\JudgeAdvancementVote;
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Gate;
|
use Illuminate\Support\Facades\Gate;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
use function compact;
|
use function compact;
|
||||||
use function redirect;
|
use function redirect;
|
||||||
use function url;
|
use function url;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class EntryFlagController extends Controller
|
||||||
return to_route('entry-flags.noShowSelect')->with('error',
|
return to_route('entry-flags.noShowSelect')->with('error',
|
||||||
'Cannot enter a no-show for an entry in an audition where seats are published');
|
'Cannot enter a no-show for an entry in an audition where seats are published');
|
||||||
}
|
}
|
||||||
if ($entry->audition->hasFlag('advance_published')) {
|
if ($entry->audition->hasFlag('advancement_published')) {
|
||||||
return to_route('entry-flags.noShowSelect')->with('error',
|
return to_route('entry-flags.noShowSelect')->with('error',
|
||||||
'Cannot enter a no-show for an entry in an audition where advancement is published');
|
'Cannot enter a no-show for an entry in an audition where advancement is published');
|
||||||
}
|
}
|
||||||
|
|
@ -71,7 +71,7 @@ class EntryFlagController extends Controller
|
||||||
return to_route('entry-flags.noShowSelect')->with('error',
|
return to_route('entry-flags.noShowSelect')->with('error',
|
||||||
'Cannot enter a no-show for an entry in an audition where seats are published');
|
'Cannot enter a no-show for an entry in an audition where seats are published');
|
||||||
}
|
}
|
||||||
if ($entry->audition->hasFlag('advance_published')) {
|
if ($entry->audition->hasFlag('advancement_published')) {
|
||||||
return to_route('entry-flags.noShowSelect')->with('error',
|
return to_route('entry-flags.noShowSelect')->with('error',
|
||||||
'Cannot enter a no-show for an entry in an audition where advancement is published');
|
'Cannot enter a no-show for an entry in an audition where advancement is published');
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +90,7 @@ class EntryFlagController extends Controller
|
||||||
return to_route('entry-flags.noShowSelect')->with('error',
|
return to_route('entry-flags.noShowSelect')->with('error',
|
||||||
'Cannot undo a no-show for an entry in an audition where seats are published');
|
'Cannot undo a no-show for an entry in an audition where seats are published');
|
||||||
}
|
}
|
||||||
if ($entry->audition->hasFlag('advance_published')) {
|
if ($entry->audition->hasFlag('advancement_published')) {
|
||||||
return to_route('entry-flags.noShowSelect')->with('error',
|
return to_route('entry-flags.noShowSelect')->with('error',
|
||||||
'Cannot undo a no-show for an entry in an audition where advancement is published');
|
'Cannot undo a no-show for an entry in an audition where advancement is published');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ namespace App\Http\Controllers\Tabulation;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
class ScoreController extends Controller
|
class ScoreController extends Controller
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Enums\AuditionFlags;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
|
@ -10,6 +11,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
|
use function in_array;
|
||||||
|
|
||||||
class Audition extends Model
|
class Audition extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
@ -75,8 +78,13 @@ class Audition extends Model
|
||||||
|
|
||||||
public function hasFlag($flag): bool
|
public function hasFlag($flag): bool
|
||||||
{
|
{
|
||||||
|
$flags = [];
|
||||||
|
foreach ($this->flags as $checkFlag) {
|
||||||
|
$flags[] = $checkFlag->flag_name->value;
|
||||||
|
}
|
||||||
|
|
||||||
// return true if any flag in $this->flags has a flag_name of declined without making another db query if flags are loaded
|
// return true if any flag in $this->flags has a flag_name of declined without making another db query if flags are loaded
|
||||||
return $this->flags->contains('flag_name', $flag);
|
return in_array($flag, $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addFlag($flag): void
|
public function addFlag($flag): void
|
||||||
|
|
@ -84,8 +92,12 @@ class Audition extends Model
|
||||||
if ($this->hasFlag($flag)) {
|
if ($this->hasFlag($flag)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$enum = match ($flag) {
|
||||||
$this->flags()->create(['flag_name' => $flag]);
|
'drawn' => AuditionFlags::DRAWN,
|
||||||
|
'seats_published' => AuditionFlags::SEATS_PUBLISHED,
|
||||||
|
'advancement_published' => AuditionFlags::ADVANCEMENT_PUBLISHED,
|
||||||
|
};
|
||||||
|
$this->flags()->create(['flag_name' => $enum]);
|
||||||
$this->load('flags');
|
$this->load('flags');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use App\Enums\AuditionFlags;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
|
|
@ -10,6 +10,10 @@ class AuditionFlag extends Model
|
||||||
{
|
{
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'flag_name' => AuditionFlags::class,
|
||||||
|
];
|
||||||
|
|
||||||
public function audition(): BelongsTo
|
public function audition(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Audition::class);
|
return $this->belongsTo(Audition::class);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
class Entry extends Model
|
class Entry extends Model
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
class User extends Authenticatable implements MustVerifyEmail
|
class User extends Authenticatable implements MustVerifyEmail
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
namespace App\Observers;
|
namespace App\Observers;
|
||||||
|
|
||||||
use App\Events\ScoreSheetChange;
|
use App\Events\ScoreSheetChange;
|
||||||
use App\Models\ScoreSheet;
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
class ScoreSheetObserver
|
class ScoreSheetObserver
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,8 @@
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Auth\Access\Response;
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
class ScoreSheetPolicy
|
class ScoreSheetPolicy
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ use App\Models\Entry;
|
||||||
use App\Models\Room;
|
use App\Models\Room;
|
||||||
use App\Models\RoomUser;
|
use App\Models\RoomUser;
|
||||||
use App\Models\School;
|
use App\Models\School;
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use App\Models\ScoringGuide;
|
use App\Models\ScoringGuide;
|
||||||
use App\Models\SeatingLimit;
|
use App\Models\SeatingLimit;
|
||||||
use App\Models\Student;
|
use App\Models\Student;
|
||||||
|
|
@ -43,6 +42,7 @@ use App\Services\SeatingService;
|
||||||
use App\Services\TabulationService;
|
use App\Services\TabulationService;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,11 @@
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use App\Models\ScoringGuide;
|
use App\Models\ScoringGuide;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
use function array_unshift;
|
use function array_unshift;
|
||||||
|
|
||||||
class ScoreService
|
class ScoreService
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
class ScoreAllAuditions extends Seeder
|
class ScoreAllAuditions extends Seeder
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
<div class="absolute left-1/2 z-10 mt-5 flex w-screen max-w-min -translate-x-1/2 px-4" x-show="open" x-cloak>
|
<div class="absolute left-1/2 z-10 mt-5 flex w-screen max-w-min -translate-x-1/2 px-4" x-show="open" x-cloak>
|
||||||
<div class="w-56 shrink rounded-xl bg-white p-4 text-sm font-semibold leading-6 text-gray-900 shadow-lg ring-1 ring-gray-900/5">
|
<div class="w-56 shrink rounded-xl bg-white p-4 text-sm font-semibold leading-6 text-gray-900 shadow-lg ring-1 ring-gray-900/5">
|
||||||
<a href="{{ route('scores.chooseEntry') }}" class="block p-2 hover:text-indigo-600">Enter Scores</a>
|
<a href="{{ route('scores.chooseEntry') }}" class="block p-2 hover:text-indigo-600">Enter Scores</a>
|
||||||
|
<a href="{{ route('entry-flags.noShowSelect') }}" class="block p-2 hover:text-indigo-600">Enter No-Shows</a>
|
||||||
<a href="{{ route('tabulation.status') }}" class="block p-2 hover:text-indigo-600">Audition Status</a>
|
<a href="{{ route('tabulation.status') }}" class="block p-2 hover:text-indigo-600">Audition Status</a>
|
||||||
<a href="{{ route('advancement.status') }}" class="block p-2 hover:text-indigo-600">{{ auditionSetting('advanceTo') }} Status</a>
|
<a href="{{ route('advancement.status') }}" class="block p-2 hover:text-indigo-600">{{ auditionSetting('advanceTo') }} Status</a>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,5 @@
|
||||||
@php use App\Models\Audition;
|
@php use App\Enums\AuditionFlags;use App\Models\Audition;use App\Models\AuditionFlag; @endphp
|
||||||
use App\Models\Entry;
|
@php @endphp
|
||||||
use App\Models\School;
|
|
||||||
use App\Models\SchoolEmailDomain;
|
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use App\Models\ScoringGuide;
|
|
||||||
use App\Models\User;use App\Services\ScoreService;use App\Settings;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Facades\Session;
|
|
||||||
@endphp
|
|
||||||
@inject('scoreservice','App\Services\ScoreService');
|
@inject('scoreservice','App\Services\ScoreService');
|
||||||
@inject('auditionService','App\Services\AuditionService');
|
@inject('auditionService','App\Services\AuditionService');
|
||||||
@inject('entryService','App\Services\EntryService')
|
@inject('entryService','App\Services\EntryService')
|
||||||
|
|
@ -17,7 +8,8 @@
|
||||||
<x-layout.app>
|
<x-layout.app>
|
||||||
<x-slot:page_title>Test Page</x-slot:page_title>
|
<x-slot:page_title>Test Page</x-slot:page_title>
|
||||||
@php
|
@php
|
||||||
$drawService->hello();
|
$audition = Audition::first();
|
||||||
|
$audition->addFlag('drawn');
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Enums\AuditionFlags;
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\AuditionFlag;
|
use App\Models\AuditionFlag;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
|
@ -12,7 +13,7 @@ test('has an audition', function () {
|
||||||
// Arrange
|
// Arrange
|
||||||
$flag = AuditionFlag::create([
|
$flag = AuditionFlag::create([
|
||||||
'audition_id' => $audition->id,
|
'audition_id' => $audition->id,
|
||||||
'flag_name' => 'Test Flag',
|
'flag_name' => AuditionFlags::DRAWN,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Act and Assert
|
// Act and Assert
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Enums\AuditionFlags;
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\AuditionFlag;
|
use App\Models\AuditionFlag;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
|
|
@ -140,13 +141,13 @@ it('has a judges_count available', function () {
|
||||||
it('can have flags', function () {
|
it('can have flags', function () {
|
||||||
// Arrange
|
// Arrange
|
||||||
$audition = Audition::factory()->create();
|
$audition = Audition::factory()->create();
|
||||||
AuditionFlag::create(['audition_id' => $audition->id, 'flag_name' => 'seats_published']);
|
AuditionFlag::create(['audition_id' => $audition->id, 'flag_name' => AuditionFlags::SEATS_PUBLISHED]);
|
||||||
AuditionFlag::create(['audition_id' => $audition->id, 'flag_name' => 'advance_published']);
|
AuditionFlag::create(['audition_id' => $audition->id, 'flag_name' => AuditionFlags::ADVANCEMENT_PUBLISHED]);
|
||||||
// Act
|
// Act
|
||||||
// Assert
|
// Assert
|
||||||
expect($audition->hasFlag('seats_published'))->toBeTrue();
|
expect($audition->hasFlag('seats_published'))->toBeTrue()
|
||||||
expect($audition->hasFlag('notaflag'))->toBeFalse();
|
->and($audition->hasFlag('notaflag'))->toBeFalse()
|
||||||
expect($audition->flags->count())->toEqual(2);
|
->and($audition->flags->count())->toEqual(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can add flags', function () {
|
it('can add flags', function () {
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,11 @@ use App\Models\Entry;
|
||||||
use App\Models\EntryFlag;
|
use App\Models\EntryFlag;
|
||||||
use App\Models\JudgeAdvancementVote;
|
use App\Models\JudgeAdvancementVote;
|
||||||
use App\Models\School;
|
use App\Models\School;
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use App\Models\Seat;
|
use App\Models\Seat;
|
||||||
use App\Models\Student;
|
use App\Models\Student;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
uses(RefreshDatabase::class);
|
uses(RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Models;
|
namespace Tests\Feature\Models;
|
||||||
|
|
||||||
|
use App\Models\Audition;
|
||||||
|
use App\Models\Entry;
|
||||||
|
use App\Models\User;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
use Illuminate\Database\Eloquent\Relations\HasOneThrough;
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
uses(RefreshDatabase::class);
|
uses(RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
use App\Models\Audition;
|
use App\Models\Audition;
|
||||||
use App\Models\Entry;
|
use App\Models\Entry;
|
||||||
use App\Models\Room;
|
use App\Models\Room;
|
||||||
use App\Models\ScoreSheet;
|
|
||||||
use App\Models\ScoringGuide;
|
use App\Models\ScoringGuide;
|
||||||
use App\Models\SubscoreDefinition;
|
use App\Models\SubscoreDefinition;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
|
@ -11,6 +10,7 @@ use App\Settings;
|
||||||
use Database\Seeders\ScoreAllAuditions;
|
use Database\Seeders\ScoreAllAuditions;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Illuminate\Support\Facades\Artisan;
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
use Tests\Feature\Models\ScoreSheet;
|
||||||
|
|
||||||
uses(RefreshDatabase::class);
|
uses(RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
@ -108,3 +108,12 @@ test('it shows scores previously entered', function () {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
it('indicates when an audition has published seats or advancement', function () {
|
||||||
|
// Arrange
|
||||||
|
$seatsPublishedAudition = Audition::factory()->create();
|
||||||
|
$advancePublishedAudition = Audition::factory()->create();
|
||||||
|
$seatsPublishedAudition->addFlag('seats_published');
|
||||||
|
$advancePublishedAudition->addFlag('advancement_published');
|
||||||
|
// Act & Assert
|
||||||
|
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ it('will not work with an entry if it is in a published audition', function () {
|
||||||
$entry1 = Entry::factory()->create();
|
$entry1 = Entry::factory()->create();
|
||||||
$entry2 = Entry::factory()->create();
|
$entry2 = Entry::factory()->create();
|
||||||
$entry1->audition->addFlag('seats_published');
|
$entry1->audition->addFlag('seats_published');
|
||||||
$entry2->audition->addFlag('advance_published');
|
$entry2->audition->addFlag('advancement_published');
|
||||||
actAsTab();
|
actAsTab();
|
||||||
get(route('entry-flags.confirmNoShow', ['entry_id' => $entry1->id]))
|
get(route('entry-flags.confirmNoShow', ['entry_id' => $entry1->id]))
|
||||||
->assertRedirect(route('entry-flags.noShowSelect'))
|
->assertRedirect(route('entry-flags.noShowSelect'))
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ it('will not record an entry in a published audition as a no show', function ()
|
||||||
$entry1 = Entry::factory()->create();
|
$entry1 = Entry::factory()->create();
|
||||||
$entry2 = Entry::factory()->create();
|
$entry2 = Entry::factory()->create();
|
||||||
$entry1->audition->addFlag('seats_published');
|
$entry1->audition->addFlag('seats_published');
|
||||||
$entry2->audition->addFlag('advance_published');
|
$entry2->audition->addFlag('advancement_published');
|
||||||
actAsAdmin();
|
actAsAdmin();
|
||||||
post(route('entry-flags.enterNoShow', $entry1))
|
post(route('entry-flags.enterNoShow', $entry1))
|
||||||
->assertRedirect(route('entry-flags.noShowSelect'))
|
->assertRedirect(route('entry-flags.noShowSelect'))
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ it('will not undo a no-show flag for an entry in a published audition', function
|
||||||
$entry1->addFlag('no_show');
|
$entry1->addFlag('no_show');
|
||||||
$entry2->addFlag('no_show');
|
$entry2->addFlag('no_show');
|
||||||
$entry1->audition->addFlag('seats_published');
|
$entry1->audition->addFlag('seats_published');
|
||||||
$entry2->audition->addFlag('advance_published');
|
$entry2->audition->addFlag('advancement_published');
|
||||||
actAsAdmin();
|
actAsAdmin();
|
||||||
delete(route('entry-flags.undoNoShow', $entry1))
|
delete(route('entry-flags.undoNoShow', $entry1))
|
||||||
->assertRedirect(route('entry-flags.noShowSelect'))
|
->assertRedirect(route('entry-flags.noShowSelect'))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue