import app Models User change
This commit is contained in:
@@ -5,7 +5,8 @@ namespace Tests\Feature;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventCategory;
|
||||
use App\Models\EventGuestsNonUsers;
|
||||
use App\User;
|
||||
use App\Models\Memo;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
@@ -49,7 +50,7 @@ class EventsTest extends TestCase
|
||||
/** @test */
|
||||
public function event_category_name_are_required()
|
||||
{
|
||||
$this->actingAs($user = factory(\App\User::class)->create(['role' => 2]), 'api');
|
||||
$this->actingAs($user = factory(\App\Models\User::class)->create(['role' => 2]), 'api');
|
||||
$response = $this->post('/api/events/categories', ['name' => '', 'description' => 'test name required']);
|
||||
|
||||
$response->assertSessionHasErrors('name');
|
||||
@@ -241,7 +242,7 @@ class EventsTest extends TestCase
|
||||
'location' => $event->location,
|
||||
'category' => [
|
||||
'data' => [
|
||||
'category_id' => 1
|
||||
'event_category_id' => 1
|
||||
],
|
||||
],
|
||||
]
|
||||
@@ -256,7 +257,7 @@ class EventsTest extends TestCase
|
||||
/** @test */
|
||||
public function event_name_are_required()
|
||||
{
|
||||
$this->actingAs($user = factory(\App\User::class)->create(), 'api');
|
||||
$this->actingAs($user = factory(\App\Models\User::class)->create(), 'api');
|
||||
$response = $this->post('/api/events', array_merge($this->data(), ['name' => '']));
|
||||
|
||||
$response->assertSessionHasErrors('name');
|
||||
@@ -266,7 +267,7 @@ class EventsTest extends TestCase
|
||||
/** @test */
|
||||
public function event_start_date_are_required()
|
||||
{
|
||||
$this->actingAs($user = factory(\App\User::class)->create(), 'api');
|
||||
$this->actingAs($user = factory(\App\Models\User::class)->create(), 'api');
|
||||
$response = $this->post('/api/events', array_merge($this->data(), ['start_date' => '']));
|
||||
|
||||
$response->assertSessionHasErrors('start_date');
|
||||
@@ -296,7 +297,7 @@ class EventsTest extends TestCase
|
||||
'location' => $event->location,
|
||||
'category' => [
|
||||
'data' => [
|
||||
'category_id' => 1
|
||||
'event_category_id' => 1
|
||||
],
|
||||
],
|
||||
]
|
||||
@@ -308,6 +309,7 @@ class EventsTest extends TestCase
|
||||
/** @test */
|
||||
public function all_event_can_be_retrieved()
|
||||
{
|
||||
$this->withoutExceptionHandling();
|
||||
$this->actingAs($user = factory(User::class)->create(), 'api');
|
||||
$events = factory(Event::class, 10)->create(['user_id' => $user->id]);
|
||||
|
||||
@@ -348,7 +350,7 @@ class EventsTest extends TestCase
|
||||
'start_date' => '2020-07-20 09:00:00',
|
||||
'category' => [
|
||||
'data' => [
|
||||
'category_id' => $event->category_id,
|
||||
'event_category_id' => $event->category_id,
|
||||
],
|
||||
],
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user