Test fixes.

This commit is contained in:
Daniel Meltzer 2020-04-29 11:01:52 -04:00
parent f8d18a8eb0
commit 1f8c3cc670
No known key found for this signature in database
GPG key ID: 91C5C7B09A5B1CA0
5 changed files with 12 additions and 14 deletions

View file

@ -14,8 +14,9 @@ use App\Models\Asset;
use App\Models\Company;
use App\Models\License;
use App\Models\User;
use Illuminate\Http\Request;
use Auth;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
class UsersController extends Controller
{

View file

@ -116,7 +116,8 @@ class ApiLicensesCest
'category_id' => $temp_license->category_id,
'termination_date' => $temp_license->termination_date,
];
// We aren't checking anyhting out in this test, so this fakes the withCount() that happens on a normal db fetch.
$temp_license->free_seats_count = $temp_license->seats;
$I->assertNotEquals($license->name, $data['name']);
// update

View file

@ -65,6 +65,7 @@ class ApiUsersCest
'notes' => $temp_user->notes,
'manager_id' => $temp_user->manager_id,
'password' => $temp_user->password,
'password_confirmation' => $temp_user->password,
'phone' => $temp_user->phone,
'state' => $temp_user->state,
'username' => $temp_user->username,

View file

@ -58,10 +58,7 @@ class GroupsCest
public function allowsDelete(FunctionalTester $I, $scenario)
{
$scenario->incomplete('Fix this test to generate a group for deleting');
$I->wantTo('Ensure I can delete a group');
// create a group
$I->amOnPage(route('groups.create'));
$I->seeResponseCodeIs(200);
@ -70,16 +67,9 @@ class GroupsCest
$I->dontSee('<span class="');
$I->seeElement('.alert-success');
// delete it
$I->amOnPage(route('groups.delete', Group::doesntHave('users')->first()->id));
$I->sendDelete(route('groups.destroy', Group::whereName('TestGroup')->doesntHave('users')->first()->id));
$I->seeResponseCodeIs(200);
$I->seeElement('.alert-success');
// $I->seeResponseCodeIs(200);
}
public function allowsEditing(FunctionalTester $I, $scenario)
{
$scenario->incomplete('Fix this test to generate a group for editing');
$I->wantTo('Ensure i can edit a group');
$I->seeResponseCodeIs(200);
}
}

View file

@ -287,6 +287,11 @@ class AssetTest extends BaseTest
'target_id' => $target->id
]);
// An Asset cannot be checked out to itself.
$target = $this->createValidAsset();
$this->expectException(CheckoutNotAllowed::class);
$target->checkOut($target, $adminUser);
// An Asset Can be checked out to a location, and this should be logged.
$target = $this->createValidLocation();