Skip to content

Commit

Permalink
Change syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
techenby committed Apr 25, 2024
1 parent 98b4da2 commit 9084b54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/Feature/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

it('returns a successful response', function () {
test('returns a successful response', function () {
$response = $this->get('/');

$response->assertStatus(200);
Expand Down
26 changes: 13 additions & 13 deletions tests/Feature/TrickTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use App\Models\User;

// Index
it('can view tricks on homepage', function () {
test('can view tricks on homepage', function () {
Trick::factory()->create(['name' => 'How to make a trick']);

$this->get(route('tricks.index'))
Expand All @@ -13,20 +13,20 @@
});

// Create
it('can view create trick page', function () {
test('can view create trick page', function () {
$this->actingAs(User::factory()->create())
->get(route('tricks.create'))
->assertStatus(200)
->assertSee('Create Trick');
});

it('cannot view create trick page as guest', function () {
test('cannot view create trick page as guest', function () {
$this->get(route('tricks.create'))
->assertStatus(302);
});

// Store
it('can store trick', function () {
test('can store trick', function () {
$this->actingAs(User::factory()->create())
->post(route('tricks.store'), [
'name' => 'How to make a Trick',
Expand All @@ -43,7 +43,7 @@
]);
});

it('cannot store invalid trick', function () {
test('cannot store invalid trick', function () {
$this->actingAs(User::factory()->create())
->post(route('tricks.store'), [
'name' => 'how',
Expand All @@ -57,7 +57,7 @@
// Show

// Edit
it('can view edit trick page', function () {
test('can view edit trick page', function () {
$user = User::factory()->create();
$trick = Trick::factory()->for($user)->create();

Expand All @@ -67,15 +67,15 @@
->assertSee('Edit Trick');
});

it('cannot view edit trick page as guest', function () {
test('cannot view edit trick page as guest', function () {
$user = User::factory()->create();
$trick = Trick::factory()->for($user)->create();

$this->get(route('tricks.edit', $trick))
->assertStatus(302);
});

it('cannot view edit trick page if not yours', function () {
test('cannot view edit trick page if not yours', function () {
$user = User::factory()->create();
$trick = Trick::factory()->for($user)->create();

Expand All @@ -85,7 +85,7 @@
});

// Update
it('can update trick', function () {
test('can update trick', function () {
$user = User::factory()->create();
$trick = Trick::factory()->for($user)->create([
'name' => 'How to make a Trick',
Expand All @@ -109,7 +109,7 @@
});
});

it('cannot update invalid trick', function () {
test('cannot update invalid trick', function () {
$user = User::factory()->create();
$trick = Trick::factory()->for($user)->create([
'name' => 'How to make a Trick',
Expand All @@ -135,7 +135,7 @@
});
});

it('cannot update trick page if not yours', function () {
test('cannot update trick page if not yours', function () {
$user = User::factory()->create();
$trick = Trick::factory()->for($user)->create();

Expand All @@ -149,7 +149,7 @@
});

// Delete
it('can delete trick', function () {
test('can delete trick', function () {
$user = User::factory()->create();
$trick = Trick::factory()->for($user)->create([
'name' => 'How to make a Trick',
Expand All @@ -168,7 +168,7 @@
]);
});

it('cannot delete trick page if not yours', function () {
test('cannot delete trick page if not yours', function () {
$user = User::factory()->create();
$trick = Trick::factory()->for($user)->create();

Expand Down

0 comments on commit 9084b54

Please sign in to comment.