Comments & Discussion
Hello. I think in the function test_company_owner_can_send_invite_to_user the line $user = User::factory()->admin()->create(); should be $user = User::factory()->companyOwner()->create(); is this correct? Thanks.
Hello. I think in the function test_company_owner_can_send_invite_to_user the line
$user = User::factory()->companyOwner()->create(); should be $user = User::factory()->companyOwner()->create(['company_id' => $company->id]);
if not, then in this line, the user doesn't have the same company $response->assertRedirect(route('companies.users.index', $company->id));
Yeah i noticed same thing i had to switch it like this for company owner
$response = $this->actingAs($companyOwner)->post(route('companies.users.store', $company->id), [ 'email' => 'test@test.com']); $response->assertRedirect(route('companies.users.index', $company->id)); // checks if mailable of type UserRegistrationInvite was sent from above line of codeMail::assertSent(UserRegistrationInvite::class);
"And the invitation email is now sent..." But I'm affraid I get an error here: Connection could not be established with host "mailpit:1025": stream_socket_client(): php_network_getaddresses: getaddrinfo for mailpit failed: Host is onbekend. / Is it necessary to register with mailgun.org? Can this be the reason for the failure? Thank you for the reply!
Hello. Some questions / corrections: