Add test for formatted_amount attribute of spendings
ADD
tests/Unit/SpendingTest.php
+<?php
+
+namespace Tests\Unit;
+
+use Tests\TestCase;
+use Illuminate\Foundation\Testing\WithFaker;
+use Illuminate\Foundation\Testing\RefreshDatabase;
+
+use App\Spending;
+
+class SpendingTest extends TestCase {
+ public function testFormattedAmount() {
+ $spending = new Spending;
+
+ $spending->user_id = 1;
+ // $spending->tag_id = null;
+ $spending->happened_on = date('Y-m-d');
+ $spending->description = 'SpendingTest testExample';
+ $spending->amount = 92;
+ $spending->save();
+
+ $this->assertEquals('92.00', $spending->formatted_amount);
+ }
+}

Add test for formatted_amount attribute of spendings