-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from dewv/yildirim_wip
Issue 34
- Loading branch information
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* @file Defines tests for the Student sailsjs model. | ||
*/ | ||
|
||
"use strict"; | ||
const helperIntegrationTests = require("./_helpers"); | ||
|
||
describe("Staff model", function() { | ||
let testData = { | ||
associations: {}, | ||
record: {} | ||
}; | ||
|
||
let testStaff = { | ||
username: "[email protected]", | ||
firstName: "TEST", | ||
lastName: "STAFF", | ||
isSlpInstructor: true, | ||
forceUpdate: true, | ||
}; | ||
|
||
// Before tests run ... | ||
before(async function() { | ||
|
||
// Destroy any old test data that might be haning around | ||
await destroyTestData(); | ||
|
||
// Create test data: associated model records | ||
// Associate, using the new IDs | ||
|
||
// Create main test record, with associations in place | ||
testData.record = await Staff.create(testStaff).fetch(); | ||
}); | ||
|
||
// After tests run ... | ||
after(destroyTestData); | ||
|
||
// Run helper integration tests | ||
helperIntegrationTests("staff", testData); | ||
|
||
async function destroyTestData() { | ||
// Destroy main test record | ||
await Staff.destroyOne({ username: testStaff.username }); | ||
|
||
// Destroy test records in associated model | ||
} | ||
}); |