Fix local maildispatcher casing
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2023-07-10 10:31:56 +02:00
parent 71e6b0216f
commit 59920bac1d
2 changed files with 16 additions and 0 deletions

View File

@ -8,5 +8,6 @@ class MailEntry extends Data
{
public function __construct(public string $email)
{
$this->email = strtolower($email);
}
}

View File

@ -3,6 +3,7 @@
namespace Tests\Feature\Maildispatcher;
use App\Activity;
use App\Maildispatcher\Models\Localmaildispatcher;
use App\Maildispatcher\Models\Maildispatcher;
use App\Mailgateway\Models\Mailgateway;
use App\Mailgateway\Types\LocalType;
@ -48,4 +49,18 @@ class StoreTest extends TestCase
'to' => 'jane@example.com',
]);
}
public function testMaildispatcherReceivesLowerVersionOfEmail(): void
{
$gateway = Mailgateway::factory()->type(LocalType::class, [])->create();
Member::factory()->defaults()->create(['email' => 'Jane@example.com']);
$this->postJson('/maildispatcher', [
'name' => 'test',
'gateway_id' => $gateway->id,
'filter' => [],
]);
$this->assertEquals('jane@example.com', Localmaildispatcher::first()->to);
}
}