Skip to content

Commit

Permalink
Add action tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebronner committed Jun 11, 2019
1 parent 85631c3 commit 43ac267
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/Integration/ActionTest.php
@@ -0,0 +1,23 @@
<?php namespace GeneaLabs\LaravelGovernor\Tests\Integration\Notifications;

use GeneaLabs\LaravelGovernor\Action;
use GeneaLabs\LaravelGovernor\Permission;
use GeneaLabs\LaravelGovernor\Tests\UnitTestCase;

class ActionTest extends UnitTestCase
{
public function testPermissionsRelationship()
{
$permission = (new Permission)->firstOrCreate([
"role_name" => "Member",
"entity_name" => "author",
"action_name" => "create",
"ownership_name" => "any",
]);
$action = (new Action)
->where("name", "create")
->first();

$this->assertTrue($action->permissions->contains($permission));
}
}
Binary file modified tests/database/database.sqlite
Binary file not shown.

0 comments on commit 43ac267

Please sign in to comment.