Port/reenable most unit tests. (#5921)

* Port/reenable most unit tests.

Should probably flesh out notifications tests in the next few days.

* Disable json checkin in ApiAssetsTest@index for now.  It's broken, but hiding other real broken things.

* Re Disable Groups allowDelete
This commit is contained in:
Daniel Meltzer
2018-07-23 09:48:21 -04:00
committed by snipe
parent 059126f642
commit de413408f5
15 changed files with 721 additions and 697 deletions
+12 -26
View File
@@ -19,31 +19,17 @@ class NotificationTest extends BaseTest
*/
protected $tester;
// public function testAUserIsEmailedIfTheyCheckoutAnAssetWithEULA()
// {
// $admin = factory(User::class)->states('superuser')->create();
// Auth::login($admin);
// $cat = factory(Category::class)->states('asset-category', 'requires-acceptance')->create();
// $model = factory(AssetModel::class)->create(['category_id' => $cat->id]);
// $asset = factory(Asset::class)->create(['model_id' => $model->id]);
public function testAUserIsEmailedIfTheyCheckoutAnAssetWithEULA()
{
$admin = factory(User::class)->states('superuser')->create();
Auth::login($admin);
$cat = $this->createValidCategory('asset-laptop-category', ['require_acceptance' => true]);
$model = $this->createValidAssetModel('mbp-13-model', ['category_id' => $cat->id]);
$asset = $this->createValidAsset(['model_id' => $model->id]);
$user = factory(User::class)->create();
Notification::fake();
$asset->checkOut($user, 1);
// $user = factory(User::class)->create();
// Notification::fake();
// $asset->checkOut($user, 1);
// Notification::assertSentTo($user, CheckoutNotification::class);
// }
// public function testAnAssetRequiringAEulaDoesNotExplodeWhenCheckedOutToALocation()
// {
// $this->signIn();
// $asset = factory(Asset::class)->states('requires-acceptance')->create();
// $this->expectException(CheckoutNotAllowed::class);
// $location = factory(Location::class)->create();
// Notification::fake();
// $asset->checkOut($location, 1);
// Notification::assertNotSentTo($location, CheckoutNotification::class);
// }
Notification::assertSentTo($user, CheckoutAssetNotification::class);
}
}