Improved first test

This commit is contained in:
PovilasKorop
2021-11-16 07:25:20 +02:00
parent 8c860fbac5
commit 37db8803e2
3 changed files with 7 additions and 7 deletions
+4 -3
View File
@@ -2,6 +2,7 @@
namespace Tests\Feature;
use App\Models\Morningnews;
use App\Models\News;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
@@ -10,13 +11,13 @@ class EloquentTest extends TestCase
{
use RefreshDatabase;
public function test_create_model_different_table()
// TASK: Make the model Morningnews work with DB table "morning_news"
public function test_create_model_incorrect_table()
{
$article = ['title' => 'Something', 'news_text' => 'Something'];
News::create($article);
Morningnews::create($article);
$this->assertDatabaseHas('morning_news', $article);
}
}