Skip to content

Commit

Permalink
Testing view content
Browse files Browse the repository at this point in the history
  • Loading branch information
REBELinBLUE committed Feb 13, 2017
1 parent 18c27d6 commit 6ac2a26
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
9 changes: 9 additions & 0 deletions app/Providers/UpdateServiceProvider.php
Expand Up @@ -13,6 +13,15 @@
**/
class UpdateServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot()
{
// Define a constant for the application version
define('APP_VERSION', trim(file_get_contents(__DIR__ . '/../../VERSION')));
}

/**
* Register the application services.
*/
Expand Down
3 changes: 0 additions & 3 deletions bootstrap/autoload.php
Expand Up @@ -2,9 +2,6 @@

define('LARAVEL_START', microtime(true));

// Define a constant for the application version
define('APP_VERSION', trim(file_get_contents(__DIR__ . '/../VERSION')));

/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
Expand Down
15 changes: 9 additions & 6 deletions tests/Feature/Admin/GroupControllerTest.php
Expand Up @@ -31,12 +31,15 @@ public function setUp()
*/
public function testIndex()
{
// FIXME: How do I test this?
//$groups = app(GroupRepositoryInterface::class)->getAll();

$response = $this->get('/admin/groups');

$response->assertStatus(Response::HTTP_OK)->assertViewHas(['title', 'groups']);

/** @var \Robbo\Presenter\View\View $json */
$view = $response->getOriginalContent();
$groups = app(GroupRepositoryInterface::class)->getAll();

$this->assertSame($groups->toJson(), $view->groups->toJson());
}

/**
Expand Down Expand Up @@ -93,9 +96,9 @@ public function testUpdateUpdatesGroup()
}

/**
* @covers ::__construct
* @covers ::update
*/
* @covers ::__construct
* @covers ::update
*/
public function testUpdateValidates()
{
factory(Group::class)->create(['name' => 'Foo']);
Expand Down

0 comments on commit 6ac2a26

Please sign in to comment.