feat: show last refresh time for Device instead of last updated

This commit is contained in:
Benjamin Nussbaum 2025-06-03 14:35:09 +02:00
parent f0b7180edd
commit 0ec6c27a53
6 changed files with 106 additions and 2 deletions

View file

@ -0,0 +1,24 @@
<?php
namespace Tests\Feature;
use App\Models\Device;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use function Pest\Laravel\actingAs;
uses(RefreshDatabase::class);
test('configure view displays last_refreshed_at timestamp', function () {
$user = User::factory()->create();
$device = Device::factory()->create([
'user_id' => $user->id,
'last_refreshed_at' => now()->subMinutes(5),
]);
$response = actingAs($user)
->get(route('devices.configure', $device));
$response->assertOk()
->assertSee('5 minutes ago');
});