diff --git a/app/Http/Controllers/SubscribeController.php b/app/Http/Controllers/SubscribeController.php index afa866a9610e..1052794220b7 100644 --- a/app/Http/Controllers/SubscribeController.php +++ b/app/Http/Controllers/SubscribeController.php @@ -67,7 +67,7 @@ public function __construct(Guard $auth) public function showSubscribe() { return View::make('subscribe.subscribe') - ->withAboutApp(Markdown::convertToHtml(Config::get('setting.app_about'))); + ->withAboutApp(Markdown::convertToHtml(Config::get('setting.app_about', ''))); } /** diff --git a/resources/views/subscribe/manage.blade.php b/resources/views/subscribe/manage.blade.php index 23472c6be3e1..cb3df4facb19 100644 --- a/resources/views/subscribe/manage.blade.php +++ b/resources/views/subscribe/manage.blade.php @@ -45,9 +45,9 @@
{{ trans('cachet.components.group.other') }}
- {{ trans('cachet.components.select_all') }} + {{ trans('cachet.components.select_all') }}  |  - {{ trans('cachet.components.deselect_all') }} + {{ trans('cachet.components.deselect_all') }}
@foreach($ungroupedComponents as $component) diff --git a/tests/SmokeTest.php b/tests/SmokeTest.php index d3f91bdd3004..b064de684ea8 100644 --- a/tests/SmokeTest.php +++ b/tests/SmokeTest.php @@ -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' => 'test@example.com'])->assertStatus(302); + + $subscriber = Subscriber::where('email', 'test@example.com')->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();