Fix issue where user stats aren't incremented on PIREP auto accept (#335)

* Fix issue where user stats aren't incremented on PIREP auto accept

* Formatting
This commit is contained in:
Nabeel S
2019-08-01 15:23:59 -04:00
committed by GitHub
parent 63485d5a0f
commit 95147e31bf
9 changed files with 79 additions and 18 deletions

View File

@@ -221,6 +221,8 @@ class PIREPTest extends TestCase
$this->assertGreaterThan($user->rank_id, $pilot->rank_id);
$this->assertEquals($last_pirep->arr_airport_id, $pilot->curr_airport_id);
$this->assertEquals(2, $pilot->flights);
//
// Submit another PIREP, adding another 6 hours
// it should automatically be accepted
@@ -238,6 +240,9 @@ class PIREPTest extends TestCase
$this->pirepSvc->submit($pirep);
$pilot->refresh();
$this->assertEquals(3, $pilot->flights);
$latest_pirep = Pirep::where('id', $pilot->last_pirep_id)->first();
// Make sure PIREP was auto updated