Skip to content

Commit

Permalink
#10 - fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilpiech97 committed Oct 4, 2023
1 parent 9ad6a27 commit 61b63e3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
2 changes: 0 additions & 2 deletions database/factories/CourseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Database\Factories;

use App\Enums\ClassType;
use App\Enums\StudyForm;
use Illuminate\Database\Eloquent\Factories\Factory;

class CourseFactory extends Factory
Expand All @@ -18,7 +17,6 @@ public function definition(): array
"description" => fake()->text,
"semester" => fake()->numberBetween(1, 10),
"type" => ClassType::Laboratory->value,
"form" => StudyForm::Stationary->value,
];
}
}
6 changes: 0 additions & 6 deletions tests/Feature/CourseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public function testCourseCanBeCreated(): void
"abbreviation" => "C",
"semester" => 2,
"type" => "laboratory",
"form" => "stationary",
])->assertSessionHasNoErrors();
}

Expand All @@ -42,23 +41,20 @@ public function testCourseCanBeUpdated(): void
"abbreviation" => "C",
"semester" => 2,
"type" => "laboratory",
"form" => "stationary",
]);

$this->patch("/dashboard/courses/{$semester->id}", [
"name" => "Course",
"abbreviation" => "C",
"semester" => 2,
"type" => "laboratory",
"form" => "stationary",
])->assertSessionHasNoErrors();

$this->assertDatabaseHas("courses", [
"name" => "Course",
"abbreviation" => "C",
"semester" => 2,
"type" => "laboratory",
"form" => "stationary",
]);
}

Expand All @@ -69,13 +65,11 @@ public function testCourseCannotBeCreatedWithInvalidData(): void
"abbreviation" => Str::random(256),
"semester" => "bad",
"type" => "lab",
"form" => "s",
])->assertSessionHasErrors([
"name",
"abbreviation",
"semester",
"type",
"form",
]);

$this->assertDatabaseCount("courses", 0);
Expand Down

0 comments on commit 61b63e3

Please sign in to comment.