Feat: Adds multi currency support (#88)
This commit is contained in:
@@ -5,12 +5,43 @@ declare(strict_types=1);
|
||||
namespace Tests;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
class AuthenticationTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_first_user_is_admin(): void
|
||||
{
|
||||
$this->post('/register', [
|
||||
'name' => 'should_be_admin',
|
||||
'email' => 'should_be_admin@example.net',
|
||||
'password' => 'password',
|
||||
'password_confirmation' => 'password',
|
||||
]);
|
||||
|
||||
$should_be_admin = User::where(['email' => 'should_be_admin@example.net'])->first();
|
||||
|
||||
$this->assertTrue($should_be_admin->admin);
|
||||
}
|
||||
|
||||
public function test_other_users_are_not_admin(): void
|
||||
{
|
||||
User::factory()->create();
|
||||
|
||||
$this->post('/register', [
|
||||
'name' => 'not_admin',
|
||||
'email' => 'not_admin@example.net',
|
||||
'password' => 'password',
|
||||
'password_confirmation' => 'password',
|
||||
]);
|
||||
|
||||
$not_admin = User::where(['email' => 'not_admin@example.net'])->first();
|
||||
|
||||
$this->assertNotTrue($not_admin->admin);
|
||||
}
|
||||
|
||||
public function test_login_screen_can_be_rendered(): void
|
||||
{
|
||||
$response = $this->get('/login');
|
||||
|
||||
Reference in New Issue
Block a user