From 8b782cc3738d7c01b2af873269ac3f980104b877 Mon Sep 17 00:00:00 2001 From: Zak Henry Date: Mon, 22 Jun 2015 12:39:27 +1000 Subject: [PATCH] Added posman backup file from the integration tests for the crud feature. --- api/postman/spira.json.postman_collection.bak | 832 ++++++++++++++++++ 1 file changed, 832 insertions(+) create mode 100644 api/postman/spira.json.postman_collection.bak diff --git a/api/postman/spira.json.postman_collection.bak b/api/postman/spira.json.postman_collection.bak new file mode 100644 index 00000000..d0ecc631 --- /dev/null +++ b/api/postman/spira.json.postman_collection.bak @@ -0,0 +1,832 @@ +{ + "id": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "name": "spira", + "description": "", + "order": [], + "folders": [ + { + "id": "93694a12-e84a-202c-1ad0-6e3a404c86fb", + "name": "0_setup", + "description": "", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287920, + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "order": [ + "2c769e5a-b2e7-34d2-4f74-ea600b1b6815", + "39aba647-ec5f-b890-eee7-04082d2ae528", + "e78cccd3-f45d-a64f-532c-f2a9917f8154" + ], + "createdAt": "2015-06-10T05:56:22.000Z", + "updatedAt": "2015-06-10T05:56:38.000Z", + "write": true, + "collection_name": "spira", + "collection_owner": "717", + "collection_id": "b29723e3-aeac-1fc7-4190-949e21ed8ab9" + }, + { + "id": "b38a066e-08a9-f063-5eeb-4d1ce4253b1c", + "name": "10_exceptionTests", + "description": "", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287921, + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "order": [ + "11d236dc-bf6f-aac9-8d08-f86c6d3468b0", + "beaf083d-6cac-bc2c-00cd-99dbfe52dd8f", + "0c8623aa-d27e-eff3-c652-e53ff1a1183f" + ], + "createdAt": "2015-06-10T05:56:23.000Z", + "updatedAt": "2015-06-10T05:56:40.000Z", + "write": true, + "collection_name": "spira", + "collection_owner": "717", + "collection_id": "b29723e3-aeac-1fc7-4190-949e21ed8ab9" + }, + { + "id": "4cccd7eb-1e1a-4693-8d72-0666cabe1366", + "name": "20_cacheTests", + "description": "", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287922, + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "order": [ + "94e47b09-7cd4-bcf1-37e5-d661b30efefe", + "b21f26e6-cbd5-de39-4a91-ed7101115ca1" + ], + "createdAt": "2015-06-10T05:56:23.000Z", + "updatedAt": "2015-06-10T05:56:35.000Z", + "write": true, + "collection_name": "spira", + "collection_owner": "717", + "collection_id": "b29723e3-aeac-1fc7-4190-949e21ed8ab9" + }, + { + "id": "719b37f0-c861-af11-166e-e76e8b6f835d", + "name": "20_emailTests", + "description": "", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287923, + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "order": [ + "d3790d79-1a2c-4a9d-04a9-4b25692eda70", + "990f1a8a-4d68-b9fd-2e01-3d995a66ccc6" + ], + "createdAt": "2015-06-10T05:56:24.000Z", + "updatedAt": "2015-06-10T05:56:36.000Z", + "write": true, + "collection_name": "spira", + "collection_owner": "717", + "collection_id": "b29723e3-aeac-1fc7-4190-949e21ed8ab9" + }, + { + "id": "06524760-ecfd-1658-eb03-d36f74598e69", + "name": "20_entityTests", + "description": "", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 288246, + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "order": [ + "39f24a52-6b2d-6fc8-d56c-5b2855e72c56", + "a7eb8fa3-783c-394c-87bc-ca8b2f111707", + "a89680a6-d9b5-2d2a-1ff1-abfb90a3e75a", + "fca1c353-e52a-29c8-e2fc-7bc691864da1", + "0f944bd9-f187-c6df-b044-8bee64c27ddb", + "4c20959a-791d-219e-c736-6673ae38483f", + "dbf5879b-e31d-a9c4-c8b3-5d9ea51b6d5b", + "739c9413-f1f8-f14c-b939-6ee017359547", + "f87d3764-6955-8fc3-34c4-6bc53b2a05b2", + "2852fce5-537d-5349-d656-b3ddf1edf351" + ], + "createdAt": "2015-06-10T05:56:25.000Z", + "updatedAt": "2015-06-10T06:44:07.000Z", + "write": true, + "collection_name": "spira", + "collection_owner": "717", + "collection_id": "b29723e3-aeac-1fc7-4190-949e21ed8ab9" + }, + { + "id": "0720f6ee-3039-926d-c61a-6374aa585d2c", + "name": "20_logTests", + "description": "", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287925, + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "order": [ + "366689fb-fad1-11c3-38cb-ee1d4e158c88" + ], + "createdAt": "2015-06-10T05:56:25.000Z", + "updatedAt": "2015-06-10T05:56:31.000Z", + "write": true, + "collection_name": "spira", + "collection_owner": "717", + "collection_id": "b29723e3-aeac-1fc7-4190-949e21ed8ab9" + }, + { + "id": "3fc55e48-447b-28ca-d5a3-69428122e591", + "name": "20_queueTests", + "description": "", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287926, + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "order": [ + "7a14093a-f482-9e65-f0aa-109fe088af02", + "893714fd-5876-4c7a-50c2-d4663e0be529", + "3ad31ed4-4747-12fd-6a52-20750d867c82" + ], + "createdAt": "2015-06-10T05:56:26.000Z", + "updatedAt": "2015-06-10T05:56:40.000Z", + "write": true, + "collection_name": "spira", + "collection_owner": "717", + "collection_id": "b29723e3-aeac-1fc7-4190-949e21ed8ab9" + } + ], + "timestamp": 0, + "owner": "717", + "remoteLink": "", + "public": false, + "createdAt": "2015-06-10T05:56:21.000Z", + "updatedAt": "2015-06-10T06:47:43.000Z", + "synced": false, + "requests": [ + { + "id": "0c8623aa-d27e-eff3-c652-e53ff1a1183f", + "name": "exception: fatal error", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "Accept: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/test/fatal-error", + "preRequestScript": "", + "tests": "\ntests[\"Status code is 500\"] = responseCode.code === 500;\n\n\ntry {\n var data = JSON.parse(responseBody);\n tests[\"Error response has message\"] = !!data.message;\n tests[\"Error message is not empty\"] = data.message.length > 0;\n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287938, + "history": null, + "folder": "b38a066e-08a9-f063-5eeb-4d1ce4253b1c", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:33.000Z", + "updatedAt": "2015-06-10T05:56:33.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "0f944bd9-f187-c6df-b044-8bee64c27ddb", + "name": "Post new test entity (valid)", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "POST", + "pathVariables": {}, + "url": "{{host}}/test/entities", + "preRequestScript": "try {\n \n var uuid = function(){\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n };\n \n var data = JSON.parse(globals.existingTestEntityJson);\n \n data.entityId = uuid();\n data.varchar = \"New Test Entity\";\n \n postman.setGlobalVariable(\"newValidTestEntity\", JSON.stringify(data));\n \n}catch(e){\n console.error(e.message);\n}\n\n", + "tests": "\ntry {\n \n var iso8601Regex = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\n \n tests[\"Status code is 201\"] = responseCode.code === 201;\n \n var data = JSON.parse(responseBody);\n tests[\"Response is object\"] = _.isObject(data);\n \n tests[\"Entity has UUID\"] = !!data.entity_id && _.isString(data.entity_id);\n tests[\"UUID has 36 chars, 4 hyphens\"] = data.entity_id.length == 36 && (data.entity_id.match(/-/g) || []).length == 4;\n \n tests[\"Varchar column type is text\"] = _.isString(data.varchar);\n tests[\"Hash column is a hash\"] = _.isString(data.hash);\n tests[\"Integer column type is integer\"] = _.isNumber(data.integer) && _.parseInt(data.integer) === data.integer;\n tests[\"Decimal column type is Decimal\"] = _.isNumber(data.decimal) && _.parseFloat(data.decimal) === data.decimal;\n tests[\"Nullable column type is null\"] = _.isNull(data.nullable);\n tests[\"Text column type is text\"] = _.isString(data.text);\n tests[\"Date column type is a valid ISO8601 date\"] = iso8601Regex.test(data.date);\n tests[\"Multi word colum is camel cased\"] = _.has(data, 'multiWordColumnTitle');\n \n tests[\"createdAt column is a valid ISO8601 date\"] = iso8601Regex.test(data.createdAt);\n tests[\"updatedAt column is a valid ISO8601 date\"] = iso8601Regex.test(data.updatedAt);\n \n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 288083, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:27.000Z", + "updatedAt": "2015-06-10T06:10:35.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false, + "rawModeData": "{{newValidTestEntity}}" + }, + { + "id": "11d236dc-bf6f-aac9-8d08-f86c6d3468b0", + "name": "exception: invalid route", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "Accept: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/this-url-does-not-exist", + "preRequestScript": "", + "tests": "tests[\"Status code is 404\"] = responseCode.code === 404;\n\ntry {\n var data = JSON.parse(responseBody);\n tests[\"Error response has message\"] = !!data.message;\n tests[\"Error message is not empty\"] = data.message.length > 0;\n}catch(e){\n tests[e.message] = false;\n}\n", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287930, + "history": null, + "folder": "b38a066e-08a9-f063-5eeb-4d1ce4253b1c", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:28.000Z", + "updatedAt": "2015-06-10T05:56:28.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "2852fce5-537d-5349-d656-b3ddf1edf351", + "name": "Check updated test entity", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/test/entities/{{firstEntityId}}", + "preRequestScript": "", + "tests": "\ntry {\n \n var data = JSON.parse(responseBody);\n \n var oldData = JSON.parse(globals.existingTestEntityJson);\n \n tests[\"Response is object\"] = _.isObject(data);\n \n var iso8601Regex = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\n \n tests[\"Status code is 200\"] = responseCode.code === 200;\n \n \n tests[\"Varchar column type has updated text\"] = data.varchar == \"Updated Test Entity\";\n \n \n tests[\"updatedAt column is a valid ISO8601 date\"] = iso8601Regex.test(data.updatedAt);\n \n tests[\"updatedAt key has updated\"] = new Date(oldData.updatedAt) < new Date(data.updatedAt);\n \n postman.setGlobalVariable(\"existingTestEntityJson\", responseBody);\n \n}catch(e){\n tests[e.message] = false;\n}\n", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 288294, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T06:44:07.000Z", + "updatedAt": "2015-06-10T06:47:43.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "2c769e5a-b2e7-34d2-4f74-ea600b1b6815", + "name": "base: check api is up", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}", + "preRequestScript": "globals.clear();", + "tests": "tests[\"Status code is 200\"] = responseCode.code === 200;", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 288106, + "history": null, + "folder": "93694a12-e84a-202c-1ad0-6e3a404c86fb", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:38.000Z", + "updatedAt": "2015-06-10T06:12:26.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "366689fb-fad1-11c3-38cb-ee1d4e158c88", + "name": "log: add", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "Content-Type: application/json\n", + "method": "POST", + "pathVariables": {}, + "url": "{{host}}/test/logs", + "preRequestScript": "", + "tests": "\ntry {\n \n tests[\"Status code is 204\"] = responseCode.code === 204;\n \n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287934, + "history": null, + "folder": "0720f6ee-3039-926d-c61a-6374aa585d2c", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:31.000Z", + "updatedAt": "2015-06-10T05:56:31.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false, + "rawModeData": "[\n {\n \"type\": \"info\",\n \"message\": \"test info log\"\n },\n {\n \"type\": \"warning\",\n \"message\": \"test warning log\"\n },\n {\n \"type\": \"error\",\n \"message\": \"test error log\"\n }\n]" + }, + { + "id": "39aba647-ec5f-b890-eee7-04082d2ae528", + "name": "email: check mailcatcher up", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{mailcatcherHost}}", + "preRequestScript": "", + "tests": "tests[\"Status code is 200\"] = responseCode.code === 200;", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287931, + "history": null, + "folder": "93694a12-e84a-202c-1ad0-6e3a404c86fb", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:29.000Z", + "updatedAt": "2015-06-10T05:56:29.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "39f24a52-6b2d-6fc8-d56c-5b2855e72c56", + "name": "Head all test entities", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "HEAD", + "pathVariables": {}, + "url": "{{host}}/test/entities", + "preRequestScript": "", + "tests": "\ntry {\n \n //header checks\n tests[\"Status code is 200\"] = responseCode.code === 200;\n tests[\"header `Content-Type` is present\"] = _.has(responseHeaders, 'Content-Type');\n tests[\"header `Content-Type` has application/json\"] = /application\\/json/.test(responseHeaders['Content-Type']);\n \n \n tests[\"header `Entity-Count` is present\"] = _.has(responseHeaders, 'Entity-Count');\n tests[\"header `Entity-Count` is > 1\"] = responseHeaders['Entity-Count'] > 1;\n \n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287943, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:37.000Z", + "updatedAt": "2015-06-10T05:56:37.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "3ad31ed4-4747-12fd-6a52-20750d867c82", + "name": "queue: count users", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/users", + "preRequestScript": "function pausecomp(millis)\n {\n var date = new Date();\n var curDate = null;\n do { curDate = new Date(); }\n while(curDate-date < millis);\n}\n\npausecomp(2000); //wait 2 seconds to allow queue runner to execute.", + "tests": "\ntry {\n \n tests[\"Status code is 200\"] = responseCode.code === 200;\n \n var data = JSON.parse(responseBody);\n tests[\"Response is array\"] = _.isArray(data);\n \n tests[\"current count (\"+data.length+\") == old count (\"+globals.userCount+\") + 1\"] = data.length === Number(globals.userCount) + 1;\n \n}catch(e){\n tests[e.message] = false;\n}\n", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287927, + "history": null, + "folder": "3fc55e48-447b-28ca-d5a3-69428122e591", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:26.000Z", + "updatedAt": "2015-06-10T05:56:26.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "4c20959a-791d-219e-c736-6673ae38483f", + "name": "Post new test entity (conflicting) ", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "POST", + "pathVariables": {}, + "url": "{{host}}/test/entities", + "preRequestScript": "try {\n \n var uuid = function(){\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n };\n \n var data = JSON.parse(globals.existingTestEntityJson);\n \n data.entityId = uuid();\n data.varchar = \"New Test Entity\";\n \n postman.setGlobalVariable(\"newValidTestEntity\", JSON.stringify(data));\n \n}catch(e){\n console.error(e.message);\n}\n\n", + "tests": "\ntry {\n \n tests[\"Status code is 409 Conflict\"] = responseCode.code === 409;\n \n var data = JSON.parse(responseBody);\n tests[\"Response is object\"] = _.isObject(data);\n tests[\"Error response has message\"] = _.has(data, 'message') && _.isString(data.message);\n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 288253, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T06:40:41.000Z", + "updatedAt": "2015-06-10T06:41:41.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false, + "rawModeData": "{{newValidTestEntity}}" + }, + { + "id": "739c9413-f1f8-f14c-b939-6ee017359547", + "name": "Post new test entity (invalid json)", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "POST", + "pathVariables": {}, + "url": "{{host}}/test/entities", + "preRequestScript": "", + "tests": "\ntry {\n \n tests[\"Status code is 400 Bad Request\"] = responseCode.code === 400;\n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287932, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:29.000Z", + "updatedAt": "2015-06-10T05:56:29.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false, + "rawModeData": "{\n \"foo\": \"bar\",\n// bad json" + }, + { + "id": "7a14093a-f482-9e65-f0aa-109fe088af02", + "name": "queue: get all users", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/users", + "preRequestScript": "", + "tests": "\ntry {\n \n tests[\"Status code is 200\"] = responseCode.code === 200;\n \n var data = JSON.parse(responseBody);\n tests[\"Response is array\"] = _.isArray(data);\n \n postman.setGlobalVariable(\"userCount\", data.length);\n \n tests[\"User count is: \"+data.length] = true;\n \n}catch(e){\n tests[e.message] = false;\n}\n", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287946, + "history": null, + "folder": "3fc55e48-447b-28ca-d5a3-69428122e591", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:38.000Z", + "updatedAt": "2015-06-10T05:56:38.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "893714fd-5876-4c7a-50c2-d4663e0be529", + "name": "queue: create user", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/test/queue", + "preRequestScript": "", + "tests": "\ntry {\n \n tests[\"Status code is 200\"] = responseCode.code === 200;\n \n var data = JSON.parse(responseBody);\n \n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287948, + "history": null, + "folder": "3fc55e48-447b-28ca-d5a3-69428122e591", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:40.000Z", + "updatedAt": "2015-06-10T05:56:40.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "94e47b09-7cd4-bcf1-37e5-d661b30efefe", + "name": "cache: add", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "Content-Type: application/json\n", + "method": "PUT", + "pathVariables": {}, + "url": "{{host}}/test/cache/cacheTest", + "preRequestScript": "", + "tests": "\ntry {\n \n tests[\"Status code is 204\"] = responseCode.code === 204;\n \n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287933, + "history": null, + "folder": "4cccd7eb-1e1a-4693-8d72-0666cabe1366", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:30.000Z", + "updatedAt": "2015-06-10T05:56:30.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false, + "rawModeData": "{\n \"key\": \"cacheTest\",\n \"value\": \"cacheValue\"\n}" + }, + { + "id": "990f1a8a-4d68-b9fd-2e01-3d995a66ccc6", + "name": "email: check mail", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{mailcatcherHost}}/messages", + "preRequestScript": "", + "tests": "\ntry {\n \n tests[\"Status code is 200\"] = responseCode.code === 200;\n \n var data = JSON.parse(responseBody);\n tests[\"Inbox has message\"] = _.isArray(data) && data.length == 1;\n \n tests[\"Email has subject\"] = _.has(data[0], 'subject');\n tests[\"Subject is 'Test Email'\"] = data[0].subject == 'Test Email';\n \n}catch(e){\n tests[e.message] = false;\n}\n", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287942, + "history": null, + "folder": "719b37f0-c861-af11-166e-e76e8b6f835d", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:36.000Z", + "updatedAt": "2015-06-10T05:56:36.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "a7eb8fa3-783c-394c-87bc-ca8b2f111707", + "name": "Get all test entities", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/test/entities", + "preRequestScript": "", + "tests": "\ntry {\n \n //header checks\n tests[\"Status code is 200\"] = responseCode.code === 200;\n tests[\"header `Content-Type` is present\"] = _.has(responseHeaders, 'Content-Type');\n tests[\"header `Content-Type` has application/json\"] = /application\\/json/.test(responseHeaders['Content-Type']);\n \n \n tests[\"header `Entity-Count` is present\"] = _.has(responseHeaders, 'Entity-Count');\n tests[\"header `Entity-Count` is > 1\"] = responseHeaders['Entity-Count'] > 1;\n \n //body checks\n var data = JSON.parse(responseBody);\n tests[\"Response is array\"] = _.isArray(data);\n tests['There is more than one entity'] = data.length > 0;\n \n postman.setGlobalVariable(\"firstEntityId\", data[0].entity_id);\n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287935, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:32.000Z", + "updatedAt": "2015-06-10T05:56:32.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "a89680a6-d9b5-2d2a-1ff1-abfb90a3e75a", + "name": "Head a test entity", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "HEAD", + "pathVariables": {}, + "url": "{{host}}/test/entities/{{firstEntityId}}", + "preRequestScript": "", + "tests": "\ntry {\n \n //header checks\n tests[\"Status code is 200\"] = responseCode.code === 200;\n tests[\"header `Content-Type` is present\"] = _.has(responseHeaders, 'Content-Type');\n tests[\"header `Content-Type` has application/json\"] = /application\\/json/.test(responseHeaders['Content-Type']);\n \n \n tests[\"header `Entity-Count` is present\"] = _.has(responseHeaders, 'Entity-Count');\n tests[\"header `Entity-Count` is 1\"] = responseHeaders['Entity-Count'] == 1;\n \n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287944, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:37.000Z", + "updatedAt": "2015-06-10T05:56:37.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "b21f26e6-cbd5-de39-4a91-ed7101115ca1", + "name": "cache: check cache", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/test/cache/cacheTest", + "preRequestScript": "", + "tests": "\ntry {\n \n tests[\"Status code is 200\"] = responseCode.code === 200;\n \n var data = JSON.parse(responseBody);\n tests[\"Cache response is object\"] = _.isObject(data);\n \n tests[\"Cache response has key\"] = _.has(data, 'key');\n tests[\"Cache response has value\"] = _.has(data, 'value');\n \n tests[\"Cache response key is correct\"] = data['key'] == 'cacheTest';\n tests[\"Cache response value is correct\"] = data['value'] == 'cacheValue';\n \n}catch(e){\n tests[e.message] = false;\n}\n", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287940, + "history": null, + "folder": "4cccd7eb-1e1a-4693-8d72-0666cabe1366", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:35.000Z", + "updatedAt": "2015-06-10T05:56:35.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "beaf083d-6cac-bc2c-00cd-99dbfe52dd8f", + "name": "exception: internal exception", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "Accept: application/json\n", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/test/internal-exception", + "preRequestScript": "", + "tests": "tests[\"Status code is 500\"] = responseCode.code === 500;\n\n\ntry {\n var data = JSON.parse(responseBody);\n tests[\"Error response has message\"] = !!data.message;\n tests[\"Error message is not empty\"] = data.message.length > 0;\n}catch(e){\n tests[e.message] = false;\n}\n", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287950, + "history": null, + "folder": "b38a066e-08a9-f063-5eeb-4d1ce4253b1c", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:40.000Z", + "updatedAt": "2015-06-10T05:56:40.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "d3790d79-1a2c-4a9d-04a9-4b25692eda70", + "name": "email: send", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "Content-Type: application/json\n", + "method": "POST", + "pathVariables": {}, + "url": "{{host}}/test/email", + "preRequestScript": "", + "tests": "\ntry {\n \n tests[\"Status code is 200\"] = responseCode.code === 200;\n \n var data = JSON.parse(responseBody);\n tests[\"Response code is 1\"] = data.response_code == 1;\n \n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287941, + "history": null, + "folder": "719b37f0-c861-af11-166e-e76e8b6f835d", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:35.000Z", + "updatedAt": "2015-06-10T05:56:35.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false, + "rawModeData": "{\n \"subject\": \"Test Email\"\n}" + }, + { + "id": "dbf5879b-e31d-a9c4-c8b3-5d9ea51b6d5b", + "name": "Post new test entity (invalid uuid)", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "POST", + "pathVariables": {}, + "url": "{{host}}/test/entities", + "preRequestScript": "try {\n \n var uuid = function(){\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n };\n \n var data = JSON.parse(globals.existingTestEntityJson);\n \n data.entityId = 'invalid-uuid';\n data.varchar = \"Invalid Test Entity\";\n \n postman.setGlobalVariable(\"newInvalidTestEntity\", JSON.stringify(data));\n \n}catch(e){\n console.error(e.message);\n}\n\n", + "tests": "\ntry {\n \n tests[\"Status code is 422 Unprocessable Entity\"] = responseCode.code === 422;\n \n var data = JSON.parse(responseBody);\n tests[\"Response is object\"] = _.isObject(data);\n tests[\"Error response has message\"] = _.has(data, 'message') && _.isString(data.message);\n tests[\"Error response has invalid object\"] = _.has(data, 'invalid') && _.isString(data.invalid);\n tests[\"Error response has invalid.entityId\"] = _.has(data, 'invalid.entityId') && _.isString(data.invalid);\n tests[\"Error response has message for invalid.entityId\"] = _.has(data, 'invalid.entityId.message') && _.isString(data.invalid.entityId.message);\n \n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 288239, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:33.000Z", + "updatedAt": "2015-06-10T06:38:55.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false, + "rawModeData": "{{newInvalidTestEntity}}" + }, + { + "id": "e78cccd3-f45d-a64f-532c-f2a9917f8154", + "name": "email: empty inbox", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "DELETE", + "pathVariables": {}, + "url": "{{mailcatcherHost}}/messages", + "preRequestScript": "", + "tests": "tests[\"Status code is 204\"] = responseCode.code === 204;", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 287939, + "history": null, + "folder": "93694a12-e84a-202c-1ad0-6e3a404c86fb", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:34.000Z", + "updatedAt": "2015-06-10T05:56:34.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + }, + { + "id": "f87d3764-6955-8fc3-34c4-6bc53b2a05b2", + "name": "Replace existing test entity (valid)", + "dataMode": "raw", + "data": [], + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "PUT", + "pathVariables": {}, + "url": "{{host}}/test/entities/{{firstEntityId}}", + "preRequestScript": "try {\n \n \n var data = JSON.parse(globals.existingTestEntityJson);\n \n data.varchar = \"Updated Test Entity\";\n \n postman.setGlobalVariable(\"updatedValidTestEntity\", JSON.stringify(data));\n \n}catch(e){\n console.error(e.message);\n}\n\n", + "tests": "\ntry {\n \n tests[\"Status code is 204\"] = responseCode.code === 204;\n \n}catch(e){\n tests[e.message] = false;\n}", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 288274, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T06:41:59.000Z", + "updatedAt": "2015-06-10T06:44:02.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false, + "rawModeData": "{{updatedValidTestEntity}}" + }, + { + "id": "fca1c353-e52a-29c8-e2fc-7bc691864da1", + "name": "Get a test entity", + "dataMode": "params", + "data": [], + "rawModeData": null, + "descriptionFormat": null, + "description": "", + "headers": "", + "method": "GET", + "pathVariables": {}, + "url": "{{host}}/test/entities/{{firstEntityId}}", + "preRequestScript": "", + "tests": "\ntry {\n \n var iso8601Regex = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\n \n tests[\"Status code is 200\"] = responseCode.code === 200;\n tests[\"header `Content-Type` is present\"] = _.has(responseHeaders, 'Content-Type');\n tests[\"header `Content-Type` has application/json\"] = /application\\/json/.test(responseHeaders['Content-Type']);\n \n \n tests[\"header `Entity-Count` is present\"] = _.has(responseHeaders, 'Entity-Count');\n tests[\"header `Entity-Count` is 1\"] = responseHeaders['Entity-Count'] == 1;\n \n var data = JSON.parse(responseBody);\n tests[\"Response is object\"] = _.isObject(data);\n \n tests[\"Entity has UUID\"] = !!data.entity_id && _.isString(data.entity_id);\n tests[\"UUID has 36 chars, 4 hyphens\"] = data.entity_id.length == 36 && (data.entity_id.match(/-/g) || []).length == 4;\n \n tests[\"Varchar column type is text\"] = _.isString(data.varchar);\n tests[\"Hash column is a hash\"] = _.isString(data.hash);\n tests[\"Integer column type is integer\"] = _.isNumber(data.integer) && _.parseInt(data.integer) === data.integer;\n tests[\"Decimal column type is Decimal\"] = _.isNumber(data.decimal) && _.parseFloat(data.decimal) === data.decimal;\n tests[\"Nullable column type is null\"] = _.isNull(data.nullable);\n tests[\"Text column type is text\"] = _.isString(data.text);\n tests[\"Date column type is a valid ISO8601 date\"] = iso8601Regex.test(data.date);\n tests[\"Multi word colum is camel cased\"] = _.has(data, 'multiWordColumnTitle');\n \n tests[\"createdAt column is a valid ISO8601 date\"] = iso8601Regex.test(data.createdAt);\n tests[\"updatedAt column is a valid ISO8601 date\"] = iso8601Regex.test(data.updatedAt);\n \n \n \n \n postman.setGlobalVariable(\"existingTestEntityJson\", responseBody);\n \n}catch(e){\n tests[e.message] = false;\n}\n", + "version": 2, + "currentHelper": "normal", + "helperAttributes": "{}", + "owner": "717", + "lastUpdatedBy": "717", + "lastRevision": 288001, + "history": null, + "folder": "06524760-ecfd-1658-eb03-d36f74598e69", + "collection": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "createdAt": "2015-06-10T05:56:39.000Z", + "updatedAt": "2015-06-10T05:59:22.000Z", + "collectionId": "b29723e3-aeac-1fc7-4190-949e21ed8ab9", + "synced": false + } + ] +} \ No newline at end of file