-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Laravel 10 + Honeypot/Newsletter data fix
- Loading branch information
1 parent
f9906a9
commit 1e2fa9a
Showing
8 changed files
with
1,264 additions
and
3,236 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use Spatie\MailcoachSdk\Facades\Mailcoach; | ||
use Tests\TestCase; | ||
|
||
class NewsletterTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_allows_you_to_subscribe_to_the_newsletter() | ||
{ | ||
config(['honeypot.enabled' => false]); | ||
|
||
Mailcoach::shouldReceive('createSubscriber') | ||
->once() | ||
->with( | ||
'mailcoach-list', | ||
[ | ||
'email' => '[email protected]', | ||
'tags' => ['Splade.dev'], | ||
], | ||
); | ||
|
||
$this->post(route('newsletter.store'), [ | ||
'email' => '[email protected]', | ||
])->assertRedirect(route('home')); | ||
} | ||
} |