Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smoke Tests #3093

Merged
merged 3 commits into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/GeneralController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* This is the general api controller.
*
* @author James Brooks <james@bluebaytravel.co.uk>
* @author James Brooks <james@alt-three.com>
*/
class GeneralController extends AbstractApiController
{
Expand Down
67 changes: 67 additions & 0 deletions tests/SmokeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace CachetHQ\Tests\Cachet;

use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\Setting;
use Illuminate\Foundation\Testing\DatabaseMigrations;

/**
* This is the smoke test class.
*
* @author James Brooks <[email protected]>
*/
class SmokeTest extends AbstractTestCase
{
use DatabaseMigrations;

public function test_setup_page()
{
$this->get('/setup')->assertStatus(200);
}

public function test_status_page()
{
$this->configureApp();

$this->get('/')->assertStatus(200);
}

public function test_single_component_page()
{
$this->configureApp();

$this->get('/incidents/1')->assertStatus(200);
}

public function test_dashboard_auth_page()
{
$this->configureApp();

$this->get('/auth/login')->assertStatus(200);
}

protected function configureApp()
{
factory(Setting::class)->create([
'name' => 'app_name',
'value' => 'Cachet Test Suite',
]);

$component = factory(Component::class)->create();

$incident = factory(Incident::class)->create([
'component_id' => $component->id,
]);
}
}