Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components Assets view + stubbed API tests #3325

Merged
merged 18 commits into from
Feb 21, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Completed test assertion
  • Loading branch information
vjandrea committed Feb 20, 2017
commit 77f0de83d0dba7ddf45ee3dfec048eb877f6c933
19 changes: 12 additions & 7 deletions tests/api/ApiComponentsAssetsCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,18 @@ public function indexComponentsAssets(ApiTester $I)
$I->assertEquals(2, $response->total);
$I->assertInstanceOf(\Illuminate\Database\Eloquent\Collection::class, $assets);

$random_asset = $assets->random();
$I->seeResponseContainsJson([
'name' => $random_asset->name,
'asset_tag' => $random_asset->asset_tag,
'serial' => $random_asset->serial,
'last_checkout' => $random_asset->last_checkout,
'notes' => $random_asset->notes,
$I->seeResponseContainsJson(['rows' => [
0 => [
'name' => $assets[0]->name,
'id' => $assets[0]->id,
'created_at' => $assets[0]->created_at->format('Y-m-d'),
],
1 => [
'name' => $assets[1]->name,
'id' => $assets[1]->id,
'created_at' => $assets[1]->created_at->format('Y-m-d'),
],
]
]);
}
}