This commit is contained in:
Cameron Dawson 2014-06-27 09:54:59 -07:00
Родитель de64d48f46
Коммит e9966e9459
1 изменённых файлов: 42 добавлений и 10 удалений

Просмотреть файл

@ -67,7 +67,15 @@ describe('ThResultSetModel', function(){
*/ */
it('should add new rs to the foreground repo', function() { it('should add new rs to the foreground repo', function() {
var rsValues = {id: 2, push_timestamp: 1396899074+1}, var rsValues = {id: 2, push_timestamp: 1396899074+1},
data = {branch: foregroundRepo, resultset: rsValues}; data = {
branch: foregroundRepo,
job_guids: {
590604: {
result_set_id: 2,
result_set_push_timestamp: 1396899074+1
}
}
};
$httpBackend.whenGET(foregroundPrefix + '/resultset/?count=1&format=json&full=true&id__in=2&offset=0&with_jobs=true').respond( $httpBackend.whenGET(foregroundPrefix + '/resultset/?count=1&format=json&full=true&id__in=2&offset=0&with_jobs=true').respond(
getResultSet(2, rsValues) getResultSet(2, rsValues)
@ -86,7 +94,15 @@ describe('ThResultSetModel', function(){
*/ */
it('should add new rs to a background repo', function() { it('should add new rs to a background repo', function() {
var rsValues = {id: 12, push_timestamp: 1396899074+1}, var rsValues = {id: 12, push_timestamp: 1396899074+1},
data = {branch: backgroundRepo, resultset: rsValues}; data = {
branch: backgroundRepo,
job_guids: {
590604: {
result_set_id: 12,
result_set_push_timestamp: 1396899074+1
}
}
};
$httpBackend.whenGET(backgroundPrefix + '/resultset/?count=1&format=json&full=true&id__in=12&offset=0&with_jobs=true').respond( $httpBackend.whenGET(backgroundPrefix + '/resultset/?count=1&format=json&full=true&id__in=12&offset=0&with_jobs=true').respond(
getResultSet(12, rsValues) getResultSet(12, rsValues)
@ -106,8 +122,12 @@ describe('ThResultSetModel', function(){
it('should add new job to the foreground repo', function() { it('should add new job to the foreground repo', function() {
var data = { var data = {
branch: foregroundRepo, branch: foregroundRepo,
id: 123, job_guids: {
resultset: {id: 1, push_timestamp: 1396899074} 123: {
result_set_id: 1,
result_set_push_timestamp: 1396899074
}
}
}; };
$httpBackend.whenGET(foregroundPrefix + '/jobs/?job_guid__in=123').respond( $httpBackend.whenGET(foregroundPrefix + '/jobs/?job_guid__in=123').respond(
@ -128,8 +148,12 @@ describe('ThResultSetModel', function(){
it('should update an existing job in the foreground repo to its new status', function() { it('should update an existing job in the foreground repo to its new status', function() {
var data = { var data = {
branch: foregroundRepo, branch: foregroundRepo,
id: 590604, job_guids: {
resultset: {id: 1, push_timestamp: 1396899074} 590604: {
result_set_id: 1,
result_set_push_timestamp: 1396899074
}
}
}; };
$httpBackend.whenGET(foregroundPrefix + '/jobs/?job_guid__in=590604').respond( $httpBackend.whenGET(foregroundPrefix + '/jobs/?job_guid__in=590604').respond(
@ -150,8 +174,12 @@ describe('ThResultSetModel', function(){
it('should add new job to the background repo', function() { it('should add new job to the background repo', function() {
var data = { var data = {
branch: backgroundRepo, branch: backgroundRepo,
id: 123, job_guids: {
resultset: {id: 10, push_timestamp: 1396899074} 123: {
result_set_id: 10,
result_set_push_timestamp: 1396899074
}
}
}; };
$httpBackend.whenGET(backgroundPrefix + '/jobs/?job_guid__in=123').respond( $httpBackend.whenGET(backgroundPrefix + '/jobs/?job_guid__in=123').respond(
@ -172,8 +200,12 @@ describe('ThResultSetModel', function(){
it('should update an existing job in the background repo to its new status', function() { it('should update an existing job in the background repo to its new status', function() {
var data = { var data = {
branch: backgroundRepo, branch: backgroundRepo,
id: 590604, job_guids: {
resultset: {id: 10, push_timestamp: 1396899074} 590604: {
result_set_id: 10,
result_set_push_timestamp: 1396899074
}
}
}; };
$httpBackend.whenGET(backgroundPrefix + '/jobs/?job_guid__in=590604').respond( $httpBackend.whenGET(backgroundPrefix + '/jobs/?job_guid__in=590604').respond(