Skip to content

Commit 5a563b8

Browse files
authored
Change tests to Pest
1 parent f23e8f6 commit 5a563b8

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/HasTagsTest.php

+8-10
Original file line numberDiff line numberDiff line change
@@ -351,25 +351,23 @@
351351
});
352352

353353
it('can check if it has a tag', function () {
354-
$model = TestModel::create(['name' => 'test model']);
355354
$tag = Tag::findOrCreate('test-tag');
356355
$anotherTag = Tag::findOrCreate('another-tag');
357356

358-
$model->attachTag($tag);
357+
$this->testModel->attachTag($tag);
359358

360-
$this->assertTrue($model->hasTag('test-tag'));
361-
$this->assertTrue($model->hasTag($tag->id));
362-
$this->assertFalse($model->hasTag('non-existing-tag'));
363-
$this->assertFalse($model->hasTag($anotherTag->id));
359+
expect($this->testModel->hasTag('test-tag'))->toBeTrue();
360+
expect($this->testModel->hasTag($tag->id))->toBeTrue();
361+
expect($this->testModel->hasTag('non-existing-tag'))->toBeFalse();
362+
expect($this->testModel->hasTag($anotherTag->id))->toBeFalse();
364363
});
365364

366365
it('can check if it has a tag with type', function () {
367-
$model = TestModel::create(['name' => 'test model']);
368366
$tag = Tag::findOrCreate('test-tag', 'type1');
369367
$sameNameDifferentType = Tag::findOrCreate('test-tag', 'type2');
370368

371-
$model->attachTag($tag);
369+
$this->testModel->attachTag($tag);
372370

373-
$this->assertTrue($model->hasTag('test-tag', 'type1'));
374-
$this->assertFalse($model->hasTag('test-tag', 'type2'));
371+
expect($this->testModel->hasTag('test-tag', 'type1'))->toBeTrue();
372+
expect($this->testModel->hasTag('test-tag', 'type2'))->toBeFalse();
375373
});

0 commit comments

Comments
 (0)