Skip to content

Commit 5260ffa

Browse files
committed
add messages tests
1 parent a5adb0e commit 5260ffa

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

tests/Feature/CommentTest.php

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/Feature/LabelTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Coderflex\LaravelTicket\Models\Label;
44
use Coderflex\LaravelTicket\Models\Ticket;
55

6-
it('can attach category to a ticket', function () {
6+
it('can attach label to a ticket', function () {
77
$label = Label::factory()->create();
88
$ticket = Ticket::factory()->create();
99

@@ -12,7 +12,7 @@
1212
$this->assertEquals($label->tickets->count(), 1);
1313
});
1414

15-
it('can deattach category to a ticket', function () {
15+
it('can deattach label to a ticket', function () {
1616
$label = Label::factory()->create();
1717
$ticket = Ticket::factory()->create();
1818

@@ -23,7 +23,7 @@
2323
$this->assertEquals($label->tickets->count(), 0);
2424
});
2525

26-
it('gets categories by visibility status', function () {
26+
it('gets labels by visibility status', function () {
2727
Label::factory()->times(7)->create([
2828
'is_visible' => true,
2929
]);

tests/Feature/MessageTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
use Coderflex\LaravelTicket\Models\Message;
4+
use Coderflex\LaravelTicket\Models\Ticket;
5+
6+
it('can attach message to a ticket', function () {
7+
$message = Message::factory()->create();
8+
$ticket = Ticket::factory()->create([
9+
'title' => 'Can you create a message?',
10+
]);
11+
12+
$message->ticket()->associate($ticket);
13+
14+
$this->assertEquals($message->ticket->title, 'Can you create a message?');
15+
});

0 commit comments

Comments
 (0)