forked from cachethq/cachet
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use last component group id for "other" section on subscription…
… page Otherwise this breaks then there aren't any component groups as it cannot use the last value the var was assigned as it never happened. #8
- Loading branch information
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,10 @@ | |
use CachetHQ\Cachet\Models\Incident; | ||
use CachetHQ\Cachet\Models\Setting; | ||
use Illuminate\Foundation\Testing\DatabaseMigrations; | ||
use Illuminate\Support\Facades\Notification; | ||
use CachetHQ\Cachet\Notifications\Subscriber\VerifySubscriptionNotification; | ||
use CachetHQ\Cachet\Models\Subscriber; | ||
use Illuminate\Support\Facades\URL; | ||
|
||
/** | ||
* This is the smoke test class. | ||
|
@@ -44,6 +48,37 @@ public function test_single_component_page() | |
$this->get('/incidents/1')->assertStatus(200); | ||
} | ||
|
||
/** | ||
* Test the subscribe process works | ||
*/ | ||
public function test_subscribe_page() | ||
{ | ||
$this->configureApp(); | ||
|
||
Notification::fake(); | ||
|
||
$this->get('/subscribe')->assertStatus(200); | ||
|
||
Notification::assertNothingSent(); | ||
|
||
$this->post('/subscribe', ['email' => '[email protected]'])->assertStatus(302); | ||
|
||
$subscriber = Subscriber::where('email', '[email protected]')->first(); | ||
|
||
Notification::assertSentTo( | ||
[$subscriber], | ||
VerifySubscriptionNotification::class | ||
); | ||
|
||
$verify_route = URL::signedRoute(cachet_route_generator('subscribe.verify'), ['code' => $subscriber->verify_code]); | ||
|
||
$this->followingRedirects()->get($verify_route)->assertStatus(200); | ||
|
||
# Subscriber should now be verified | ||
$subscriber->refresh(); | ||
$this->assertEquals(true, $subscriber->getIsVerifiedAttribute()); | ||
} | ||
|
||
public function test_dashboard_auth_page() | ||
{ | ||
$this->configureApp(); | ||
|