1
0
Fork 0

Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel

This commit is contained in:
Thomas Schmidts 2014-07-11 09:29:46 +02:00
commit 256c7d51de
2 changed files with 13 additions and 4 deletions

View File

@ -20,6 +20,9 @@
isTestSetup : function () { isTestSetup : function () {
return undefined; return undefined;
}, },
cleanUp : function () {
return undefined;
},
destroy : function () { destroy : function () {
return undefined; return undefined;
} }
@ -158,10 +161,12 @@
}); });
spyOn(window.App, "navigate"); spyOn(window.App, "navigate");
spyOn(window.App.clusterPlan, "isTestSetup").andReturn(false); spyOn(window.App.clusterPlan, "isTestSetup").andReturn(false);
spyOn(window.App.clusterPlan, "cleanUp");
spyOn(jquerydummy, "modal"); spyOn(jquerydummy, "modal");
view.submitEditPlan(); view.submitEditPlan();
expect(jquerydummy.modal).toHaveBeenCalledWith("hide"); expect(jquerydummy.modal).toHaveBeenCalledWith("hide");
expect(window.App.clusterPlan.cleanUp).toHaveBeenCalled();
expect(window.App.navigate).toHaveBeenCalledWith("planAsymmetrical", {trigger : true}); expect(window.App.navigate).toHaveBeenCalledWith("planAsymmetrical", {trigger : true});
}); });
@ -178,9 +183,11 @@
}); });
spyOn(window.App, "navigate"); spyOn(window.App, "navigate");
spyOn(window.App.clusterPlan, "isTestSetup").andReturn(true); spyOn(window.App.clusterPlan, "isTestSetup").andReturn(true);
spyOn(window.App.clusterPlan, "cleanUp");
spyOn(jquerydummy, "modal"); spyOn(jquerydummy, "modal");
view.submitEditPlan(); view.submitEditPlan();
expect(window.App.clusterPlan.cleanUp).toHaveBeenCalled();
expect(jquerydummy.modal).toHaveBeenCalledWith("hide"); expect(jquerydummy.modal).toHaveBeenCalledWith("hide");
expect(window.App.navigate).toHaveBeenCalledWith("planTest", {trigger : true}); expect(window.App.navigate).toHaveBeenCalledWith("planTest", {trigger : true});
@ -198,13 +205,16 @@
return jquerydummy; return jquerydummy;
} }
}); });
spyOn(window, "ClusterPlan").andReturn(window.App.clusterPlan);
spyOn(window.App, "navigate"); spyOn(window.App, "navigate");
spyOn(window.App, "planScenario"); spyOn(window.App, "planScenario");
spyOn(window.App.clusterPlan, "cleanUp");
spyOn(window.App.clusterPlan, "destroy"); spyOn(window.App.clusterPlan, "destroy");
spyOn(jquerydummy, "modal"); spyOn(jquerydummy, "modal");
view.submitDeletePlan(); view.submitDeletePlan();
expect(jquerydummy.modal).toHaveBeenCalledWith("hide"); expect(jquerydummy.modal).toHaveBeenCalledWith("hide");
expect(window.App.clusterPlan.cleanUp).toHaveBeenCalled();
expect(window.App.planScenario).toHaveBeenCalled(); expect(window.App.planScenario).toHaveBeenCalled();
}); });

View File

@ -5855,7 +5855,6 @@ function GENERAL_GRAPH_NEIGHBORS (graphName,
options.startVertexCollectionRestriction = options.vertexCollectionRestriction; options.startVertexCollectionRestriction = options.vertexCollectionRestriction;
} }
} }
var neighbors = [], var neighbors = [],
params = TRAVERSAL_PARAMS(), params = TRAVERSAL_PARAMS(),
factory = TRAVERSAL.generalGraphDatasourceFactory(graphName); factory = TRAVERSAL.generalGraphDatasourceFactory(graphName);
@ -5865,11 +5864,11 @@ function GENERAL_GRAPH_NEIGHBORS (graphName,
params.paths = true; params.paths = true;
options.edgeExamples = options.edgeExamples || {}; options.edgeExamples = options.edgeExamples || {};
params.visitor = TRAVERSAL_NEIGHBOR_VISITOR; params.visitor = TRAVERSAL_NEIGHBOR_VISITOR;
var graph = RESOLVE_GRAPH_TO_DOCUMENTS(graphName, options); var graph = RESOLVE_GRAPH_TO_DOCUMENTS(graphName, options);
params.followEdges = MERGE_EXAMPLES_WITH_EDGES(options.edgeExamples, graph.edges); params.followEdges = MERGE_EXAMPLES_WITH_EDGES(options.edgeExamples, graph.edges);
if (params.followEdges.length === 0) {
return [];
}
graph.fromVertices.forEach(function (v) { graph.fromVertices.forEach(function (v) {
var e = TRAVERSAL_FUNC("GRAPH_NEIGHBORS", var e = TRAVERSAL_FUNC("GRAPH_NEIGHBORS",
factory, factory,