This repository has been archived by the owner on Dec 4, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aec4a9c
commit 003ff36
Showing
5 changed files
with
65 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict'; | ||
var request = require('request'); | ||
|
||
exports.find = function(req, res) { | ||
|
||
}; | ||
|
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,17 @@ | ||
var mongoose = require('mongoose'); | ||
|
||
var repoSchema = new mongoose.Schema({ | ||
repo: String, | ||
commits: [{ sha: String}] | ||
}); | ||
|
||
var commitSchema = new mongoose.Schema({ | ||
repo: String, | ||
sha: String, | ||
date: { type: Date, default: Date.now }, | ||
flintOutput: [{ file: String, lineno: Number, message: String }], | ||
flintStatus: Number | ||
}); | ||
|
||
exports.Repo = mongoose.model('Repo', repoSchema); | ||
exports.Commit = mongoose.model('Commit', commitSchema); |
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,43 @@ | ||
'use strict'; | ||
var should = require('should'); | ||
var models = require('../models'); | ||
|
||
describe('repo', function() { | ||
it('can be created', function() { | ||
var repo = new models.Repo({ | ||
repo: 'sandstorm-io/sandstorm', | ||
commits: [{ sha: '60d806b05653d2d8c305a06928bebf604d3a6009'}, | ||
{ sha: '1ab9d877b6efe62a1eb190024cd67cbc6d91d21a' }] | ||
}); | ||
should(repo.repo).equal('sandstorm-io/sandstorm'); | ||
should(repo.commits.length).equal(2); | ||
}); | ||
}); | ||
|
||
describe('commit', function() { | ||
it('can be created', function() { | ||
var c1 = new models.Commit({ | ||
repo: 'sandstorm-io/sandstorm', | ||
sha: '60d806b05653d2d8c305a06928bebf604d3a6009', | ||
date: new Date(), | ||
flintStatus: 0 | ||
}); | ||
var c2 = new models.Commit({ | ||
repo: 'sandstorm-io/sandstorm', | ||
sha: '1ab9d877b6efe62a1eb190024cd67cbc6d91d21a', | ||
date: new Date(), | ||
flintOutput: [{ file: 'root/src/sodium/api.h', | ||
lineno: 1, | ||
message: 'Missing include guard.' | ||
}, | ||
{ file: 'root/src/sandstorm/union-fs.c++', | ||
lineno: 575, | ||
message: 'Single-argument constructor may inadvertedly be used as a type conversion constructor.' | ||
}], | ||
flintStatus: 1 | ||
}); | ||
should.exist(c1.date); | ||
should(c1.flintOutput.length).equal(0); | ||
should(c2.flintOutput.length).equal(2); | ||
}); | ||
}); |