补齐座驾购买金币流水

This commit is contained in:
pllx
2026-04-30 10:02:59 +08:00
parent 363c45a140
commit b60f3615c1
5 changed files with 58 additions and 10 deletions
+14
View File
@@ -8,6 +8,7 @@
namespace Tests\Feature;
use App\Enums\CurrencySource;
use App\Models\Ride;
use App\Models\Room;
use App\Models\User;
@@ -80,6 +81,10 @@ class RideControllerTest extends TestCase
'user_id' => $user->id,
'ride_id' => $ride->id,
]);
$this->assertDatabaseMissing('user_currency_logs', [
'user_id' => $user->id,
'source' => CurrencySource::RIDE_BUY->value,
]);
}
/**
@@ -108,6 +113,15 @@ class RideControllerTest extends TestCase
'status' => 'active',
'price_paid' => 18888,
]);
$this->assertDatabaseHas('user_currency_logs', [
'user_id' => $user->id,
'currency' => 'gold',
'amount' => -18888,
'balance_after' => 11112,
'source' => CurrencySource::RIDE_BUY->value,
'remark' => '购买聊天室座驾:测试座驾',
'room_id' => $room->id,
]);
}
/**