mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 05:47:28 -08:00
Test fixes.
This commit is contained in:
parent
f8d18a8eb0
commit
1f8c3cc670
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue