Fix admin content tab retention on test mail & save, add SMTP encryption support, and provide Gmail DNS deliverability diagnostic guidance
This commit is contained in:
@@ -10,6 +10,7 @@ use App\Models\User;
|
||||
use App\Services\PriceCalculatorService;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -407,4 +408,27 @@ class AdminContentTest extends TestCase
|
||||
$this->assertEquals(45, (int) Setting::get('calc_default_markup'));
|
||||
$this->assertEquals(8, (int) Setting::get('calc_failure_rate'));
|
||||
}
|
||||
|
||||
public function test_sending_test_mail_redirects_and_stays_on_email_tab(): void
|
||||
{
|
||||
Mail::fake();
|
||||
|
||||
$response = $this->actingAs($this->admin)->post(route('admin.content.test-mail'), [
|
||||
'test_email' => 'niek.rabelink@gmail.com',
|
||||
]);
|
||||
|
||||
$response->assertRedirect(route('admin.content.index', ['tab' => 'email']));
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
|
||||
public function test_updating_content_with_active_tab_preserves_tab(): void
|
||||
{
|
||||
$response = $this->actingAs($this->admin)->post(route('admin.content.update'), [
|
||||
'active_tab' => 'calculator',
|
||||
'site_name' => 'Jouwdriedee 3D Print Studio',
|
||||
]);
|
||||
|
||||
$response->assertRedirect(route('admin.content.index', ['tab' => 'calculator']));
|
||||
$response->assertSessionHas('success');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user