Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
<?php
declare(strict_types=1);
use App\Models\Account;
use App\Models\Invite;
use App\Models\User;
use App\Models\Workspace;
beforeEach(function () {
config(['trypost.self_hosted' => true]);
$this->account = Account::factory()->create();
$this->owner = User::factory()->create(['account_id' => $this->account->id]);
$this->account->update(['owner_id' => $this->owner->id]);
$this->workspace = Workspace::factory()->create([
'account_id' => $this->account->id,
'user_id' => $this->owner->id,
]);
$this->invite = Invite::factory()->create([
'account_id' => $this->account->id,
'invited_by' => $this->owner->id,
'email' => '[email protected]',
'workspaces' => [$this->workspace->id],
]);
});
test('register page receives the invite id', function () {
$this->get(route('register', [
'email' => '[email protected]',
'invite' => $this->invite->id,
]))
->assertOk()
->assertInertia(fn ($page) => $page
->where('invite', $this->invite->id)
->where('email', '[email protected]')
);
});
test('invite registration rejects a different email than the invite', function () {
$this->post(route('register.store'), [
'name' => 'Invitee',
'email' => '[email protected]',
'password' => strongPassword(),
'password_confirmation' => strongPassword(),
'invite' => $this->invite->id,
'locale' => 'en',
])->assertSessionHasErrors('email');
expect(User::where('email', '[email protected]')->exists())->toBeFalse();
});
test('invite registration allows the invited email', function () {
$this->post(route('register.store'), [
'name' => 'Invitee',
'email' => '[email protected]',
'password' => strongPassword(),
'password_confirmation' => strongPassword(),
'invite' => $this->invite->id,
'locale' => 'en',
])->assertRedirect(route('app.invites.show', $this->invite));
expect(User::where('email', '[email protected]')->exists())->toBeTrue();
});