Skip to content
Snippets Groups Projects
Commit 5cd0ca7e authored by Ambrus Simon's avatar Ambrus Simon
Browse files

fix abao tests: do not rely on analyses attr in "GET /{Container}" (get_all) response

parent d6780ba5
No related branches found
No related tags found
No related merge requests found
......@@ -347,6 +347,8 @@ hooks.before("GET /groups/{GroupId}/projects -> 200", function(test, done) {
done();
});
// set initial test_collection_1
hooks.after("GET /collections -> 200", function(test, done) {
test_collection_1 = test.response.body[0];
collection_id = test.response.body[0]._id;
......@@ -359,6 +361,12 @@ hooks.before("GET /collections/{CollectionId} -> 200", function(test, done) {
done();
});
// set detailed test_collection_1 (including analyses, that are omitted during listing)
hooks.after("GET /collections/{CollectionId} -> 200", function(test, done) {
test_collection_1 = test.response.body;
done();
});
hooks.before("GET /collections/{CollectionId}/sessions -> 200", function(test, done) {
test.request.params.CollectionId = collection_id;
done();
......@@ -636,6 +644,8 @@ hooks.before("DELETE /collections/{CollectionId}/analyses/{AnalysisId}/notes/{No
done();
});
// set initial test_session_1
hooks.after("GET /sessions -> 200", function(test, done) {
test_session_1 = test.response.body[0];
assert.equal(test_session_1.label, "test-session-1");
......@@ -647,6 +657,12 @@ hooks.before("GET /sessions/{SessionId} -> 200", function(test, done) {
done();
});
// set detailed test_session_1 (including analyses, that are omitted during listing)
hooks.after("GET /sessions/{SessionId} -> 200", function(test, done) {
test_session_1 = test.response.body;
done();
});
hooks.after("GET /sessions/{SessionId} -> 200", function(test, done) {
test_session_1 = test.response.body;
assert.equal(test_session_1.label, "test-session-1");
......@@ -899,6 +915,7 @@ hooks.before("DELETE /sessions/{SessionId}/analyses/{AnalysisId}/notes/{NoteId}
// set initial test_acquisition_1
hooks.after("GET /acquisitions -> 200", function(test, done) {
test_acquisition_1 = test.response.body[0];
assert.equal(test_acquisition_1.label, "test-acquisition-1");
......@@ -910,6 +927,12 @@ hooks.before("GET /acquisitions/{AcquisitionId} -> 200", function(test, done) {
done();
});
// set detailed test_acquisition_1 (including analyses, that are omitted during listing)
hooks.after("GET /acquisitions/{AcquisitionId} -> 200", function(test, done) {
test_acquisition_1 = test.response.body;
done();
});
hooks.before("POST /acquisitions -> 200", function(test, done) {
test.request.body.session = test_session_1._id;
done();
......@@ -1137,6 +1160,8 @@ hooks.before("DELETE /acquisitions/{AcquisitionId}/analyses/{AnalysisId}/notes/{
done();
});
// set initial test_project_1
hooks.after("GET /projects -> 200", function(test, done) {
test_project_1 = test.response.body[0];
assert.equal(test_project_1.label, "test-project-1");
......@@ -1158,6 +1183,12 @@ hooks.before("GET /projects/{ProjectId} -> 200", function(test, done) {
done();
});
// set detailed test_project_1 (including analyses, that are omitted during listing)
hooks.after("GET /projects/{ProjectId} -> 200", function(test, done) {
test_project_1 = test.response.body;
done();
});
hooks.before("PUT /projects/{ProjectId} -> 400", function(test, done) {
test.request.params.ProjectId = test_project_1._id;
test.request.body = {"not_real":"fake property"};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment