diff --git a/app/Http/Controllers/EntryController.php b/app/Http/Controllers/EntryController.php index c2ac9c7..c102318 100644 --- a/app/Http/Controllers/EntryController.php +++ b/app/Http/Controllers/EntryController.php @@ -11,7 +11,6 @@ use function abort; class EntryController extends Controller { - // TODO authorization policies public function index() { @@ -31,7 +30,6 @@ class EntryController extends Controller if ($request->user()->cannot('create', Entry::class)) { abort(403); } - // TODO write custom rule to verify the combination of student and audition is unique $validData = $request->validate([ 'student_id' => ['required', 'exists:students,id'], 'audition_id' => ['required', 'exists:auditions,id'], diff --git a/app/Http/Controllers/StudentController.php b/app/Http/Controllers/StudentController.php index 10a616a..6390220 100644 --- a/app/Http/Controllers/StudentController.php +++ b/app/Http/Controllers/StudentController.php @@ -3,7 +3,6 @@ namespace App\Http\Controllers; use App\Models\Audition; -use App\Models\School; use App\Models\Student; use App\Rules\UniqueFullNameAtSchool; use Illuminate\Http\Request; @@ -12,7 +11,6 @@ use Illuminate\Support\Facades\Auth; use function abort; use function redirect; -// TODO validation rules to make sure a student name is unique at a school class StudentController extends Controller { /** @@ -106,8 +104,6 @@ class StudentController extends Controller 'grade' => request('grade'), ]); - // TODO if a students grade is changed, we need to be sure they are still eligible for the auditions in which they are entered. - return redirect('/students')->with('success', 'Student updated successfully.'); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 5a30496..e21d0a6 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -84,7 +84,6 @@ class UserController extends Controller 'school_id' => request('school_id'), ]); - // TODO we probably don't want to go here if done from an admin page return redirect('/my_school'); } } diff --git a/app/Models/ScoreSheet.php b/app/Models/ScoreSheet.php index 1d41ccc..b80b95b 100644 --- a/app/Models/ScoreSheet.php +++ b/app/Models/ScoreSheet.php @@ -47,7 +47,6 @@ class ScoreSheet extends Model public function isValid() { - // TODO move to either TabulationService or a specific service for scoreValidation $judges = $this->audition->judges; return $judges->contains('id', $this->judge->id); diff --git a/app/Models/ScoringGuide.php b/app/Models/ScoringGuide.php index 264a1a8..41eb451 100644 --- a/app/Models/ScoringGuide.php +++ b/app/Models/ScoringGuide.php @@ -35,7 +35,6 @@ class ScoringGuide extends Model */ public function validateScores(array $prospective_score) { - // TODO move to either TabulationService or a specific service for scoreValidation foreach ($this->subscores as $subscore) { if (! array_key_exists($subscore->id, $prospective_score)) { return 'A score must be provided for '.$subscore->name; @@ -55,6 +54,5 @@ class ScoringGuide extends Model } return 'success'; - // TODO this probably needs to be rewritten as a validation rule } } diff --git a/app/Models/User.php b/app/Models/User.php index 0cf53b1..45734f6 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -160,13 +160,11 @@ class User extends Authenticatable implements MustVerifyEmail public function scoresForEntry($entry) { - // TODO Again, why is this here? Needs to go somewhere else. Maybe a Judging service return $this->scoreSheets->where('entry_id', '=', $entry)->first()?->subscores; } public function timeForEntryScores($entry) { - // TODO Why is this in the User mode? Move it somewhere else return $this->scoreSheets->where('entry_id', '=', $entry)->first()?->created_at; } } diff --git a/tests/Feature/Pages/Seating/auditionSeatingTest.php b/tests/Feature/Pages/Seating/auditionSeatingTest.php index 4858a9c..4f95597 100644 --- a/tests/Feature/Pages/Seating/auditionSeatingTest.php +++ b/tests/Feature/Pages/Seating/auditionSeatingTest.php @@ -37,7 +37,6 @@ it('grants access to tabulators', function () { // Act & Assert get($this->r)->assertOk(); }); -// TODO make tests with varied information it('returns the audition object and an array of info on each entry', function () { // Arrange $entry = Entry::factory()->create(['audition_id' => $this->audition->id]); diff --git a/tests/Feature/Pages/Setup/EnsemblesIndexTest.php b/tests/Feature/Pages/Setup/EnsemblesIndexTest.php index 04218cb..9d200f0 100644 --- a/tests/Feature/Pages/Setup/EnsemblesIndexTest.php +++ b/tests/Feature/Pages/Setup/EnsemblesIndexTest.php @@ -1,4 +1,6 @@ -assertOk(); $response->assertSee(route('admin.ensembles.destroy', $noSeatsEnsemble), false); - //$response->assertDontSee(route('admin.ensembles.destroy', $seatsEnsemble), false); // TODO figure out how to test for a delete form that does not also see an edit form }); it('allows an administrator to delete an ensemble while no entries are seated', function () { // Arrange diff --git a/tests/Feature/Pages/Setup/SettingsTest.php b/tests/Feature/Pages/Setup/SettingsTest.php index e53e89c..1a1dc2c 100644 --- a/tests/Feature/Pages/Setup/SettingsTest.php +++ b/tests/Feature/Pages/Setup/SettingsTest.php @@ -4,8 +4,8 @@ use Illuminate\Foundation\Testing\RefreshDatabase; use Sinnbeck\DomAssertions\Asserts\AssertForm; - use Sinnbeck\DomAssertions\Asserts\AssertSelect; + use function Pest\Laravel\get; use function Pest\Laravel\post; @@ -67,11 +67,11 @@ it('has a field with forms for each audition setting', function () { ]) ->containsInput([ 'name' => 'late_fee', - 'value' => number_format(auditionSetting('late_fee')/100, 2), + 'value' => number_format(auditionSetting('late_fee') / 100, 2), ]) ->containsInput([ 'name' => 'school_fee', - 'value' => number_format(auditionSetting('school_fee')/100, 2), + 'value' => number_format(auditionSetting('school_fee') / 100, 2), ]) ->containsInput([ 'name' => 'payment_address', @@ -93,21 +93,19 @@ it('has a field with forms for each audition setting', function () { ->containsInput([ 'name' => 'olympic_scoring', 'type' => 'checkbox', - // TODO how can I test if it is checked when necessary ]) ->containsInput([ 'name' => 'judging_enabled', 'type' => 'checkbox', - // TODO how can I test if it is checked when necessary ]) - ->findSelect('#fee_structure', function(AssertSelect $select) { + ->findSelect('#fee_structure', function (AssertSelect $select) { $select->containsOption([ 'value' => 'oneFeePerEntry', - 'text'=> 'One fee per entry', + 'text' => 'One fee per entry', ]) ->containsOption([ - 'value' => 'oneFeePerStudent', - 'text' => 'One fee per student - one late fee per student if any of their entries are late', + 'value' => 'oneFeePerStudent', + 'text' => 'One fee per student - one late fee per student if any of their entries are late', ]); }); }); @@ -128,7 +126,7 @@ it('can update audition settings', function () { 'payment_city' => 'New City', 'payment_state' => 'NS', 'payment_zip' => 12345, - 'fee_structure' => 'oneFeePerEntry' + 'fee_structure' => 'oneFeePerEntry', ]; // Act $response = post(route('audition-settings-save'), $newData);