{ "info": { "_postman_id": "ce2e00a3-c47e-4996-876e-ac9daf278fa8", "name": "Conduit", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Populate Blog", "item": [ { "name": "Register User", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "if (!(environment.isIntegrationTest)) {", "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"user\" property'] = responseJSON.hasOwnProperty('user');", "", "var user = responseJSON.user || {};", "", "}", "" ] } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" } ], "body": { "mode": "raw", "raw": "{\"user\":{\"email\":\"{{EMAIL}}\", \"password\":\"{{PASSWORD}}\", \"username\":\"{{USERNAME}}\"}}" }, "url": { "raw": "{{APIURL}}/users", "host": [ "{{APIURL}}" ], "path": [ "users" ] } }, "response": [] }, { "name": "Login and Remember Token", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"user\" property'] = responseJSON.hasOwnProperty('user');", "", "var user = responseJSON.user || {};", "", "if(tests['User has \"token\" property']){", " pm.globals.set('token', user.token);", "}", "", "pm.globals.get('token') === user.token;", "" ] } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" } ], "body": { "mode": "raw", "raw": "{\"user\":{\"email\":\"{{EMAIL}}\", \"password\":\"{{PASSWORD}}\"}}" }, "url": { "raw": "{{APIURL}}/users/login", "host": [ "{{APIURL}}" ], "path": [ "users", "login" ] } }, "response": [] }, { "name": "Create Article #1", "event": [ { "listen": "test", "script": { "exec": [ "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"article\" property'] = responseJSON.hasOwnProperty('article');", "", "var article = responseJSON.article || {};", "", "pm.globals.set('slug', article.slug);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "body": { "mode": "raw", "raw": "{\"article\":{\"title\":\"Welcome to RealWorld project\",\"description\":\"Exemplary fullstack Medium.com clone powered by React, Angular, Node, Django, and many more\",\"body\":\"See how the exact same Medium.com clone (called Conduit) is built using different frontends and backends. Yes, you can mix and match them, because they all adhere to the same API spec\",\"tagList\":[\"welcome\",\"introduction\"]}}" }, "url": { "raw": "{{APIURL}}/articles", "host": [ "{{APIURL}}" ], "path": [ "articles" ] } }, "response": [] }, { "name": "Create Comment #1 for Article #3", "event": [ { "listen": "test", "script": { "exec": [ "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"comment\" property'] = responseJSON.hasOwnProperty('comment');", "", "var comment = responseJSON.comment || {};", "", "tests['Comment has \"id\" property'] = comment.hasOwnProperty('id');", "pm.globals.set('commentId', comment.id);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "body": { "mode": "raw", "raw": "{\"comment\":{\"body\":\"While most 'todo' demos provide an excellent cursory glance at a framework's capabilities, they typically don't convey the knowledge & perspective required to actually build real applications with it.\"}}" }, "url": { "raw": "{{APIURL}}/articles/{{slug}}/comments", "host": [ "{{APIURL}}" ], "path": [ "articles", "{{slug}}", "comments" ] } }, "response": [] }, { "name": "Create Comment #2 for Article #3", "event": [ { "listen": "test", "script": { "exec": [ "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"comment\" property'] = responseJSON.hasOwnProperty('comment');", "", "var comment = responseJSON.comment || {};", "", "tests['Comment has \"id\" property'] = comment.hasOwnProperty('id');", "pm.globals.set('commentId', comment.id);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "body": { "mode": "raw", "raw": "{\"comment\":{\"body\":\"RealWorld solves this by allowing you to choose any frontend (React, Angular, & more) and any backend (Node, Django, & more) and see how they power a real-world, beautifully designed full-stack app called Conduit.\"}}" }, "url": { "raw": "{{APIURL}}/articles/{{slug}}/comments", "host": [ "{{APIURL}}" ], "path": [ "articles", "{{slug}}", "comments" ] } }, "response": [] }, { "name": "Create Article #2", "event": [ { "listen": "test", "script": { "exec": [ "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"article\" property'] = responseJSON.hasOwnProperty('article');", "", "var article = responseJSON.article || {};", "", "tests['Article has \"title\" property'] = article.hasOwnProperty('title');", "tests['Article has \"slug\" property'] = article.hasOwnProperty('slug');", "pm.globals.set('slug', article.slug);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "body": { "mode": "raw", "raw": "{\"article\":{\"title\":\"Explore implementations\",\"description\":\"discover the implementations created by the RealWorld community\",\"body\":\"Over 100 implementations have been created using various languages, libraries, and frameworks.\\n\\nExplore them on CodebaseShow.\",\"tagList\":[\"codebaseShow\",\"implementations\"]}}" }, "url": { "raw": "{{APIURL}}/articles", "host": [ "{{APIURL}}" ], "path": [ "articles" ] } }, "response": [] }, { "name": "Create Comment #1 for Article #2", "event": [ { "listen": "test", "script": { "exec": [ "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"comment\" property'] = responseJSON.hasOwnProperty('comment');", "", "var comment = responseJSON.comment || {};", "", "tests['Comment has \"id\" property'] = comment.hasOwnProperty('id');", "pm.globals.set('commentId', comment.id);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "body": { "mode": "raw", "raw": "{\"comment\":{\"body\":\"There are 3 categories: Frontend, Backend and FullStack\"}}" }, "url": { "raw": "{{APIURL}}/articles/{{slug}}/comments", "host": [ "{{APIURL}}" ], "path": [ "articles", "{{slug}}", "comments" ] } }, "response": [] }, { "name": "Create Article #3", "event": [ { "listen": "test", "script": { "exec": [ "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"article\" property'] = responseJSON.hasOwnProperty('article');", "", "var article = responseJSON.article || {};", "", "tests['Article has \"title\" property'] = article.hasOwnProperty('title');", "tests['Article has \"slug\" property'] = article.hasOwnProperty('slug');", "pm.globals.set('slug', article.slug);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "body": { "mode": "raw", "raw": "{\"article\":{\"title\":\"Create a new implementation\",\"description\":\"join the community by creating a new implementation\",\"body\":\"Share your knowledge and empower the community by creating a new implementation\"\r\n,\"tagList\":[\"implementations\"]}}" }, "url": { "raw": "{{APIURL}}/articles", "host": [ "{{APIURL}}" ], "path": [ "articles" ] } }, "response": [] }, { "name": "Create Comment #1 for Article #3", "event": [ { "listen": "test", "script": { "exec": [ "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"comment\" property'] = responseJSON.hasOwnProperty('comment');", "", "var comment = responseJSON.comment || {};", "", "tests['Comment has \"id\" property'] = comment.hasOwnProperty('id');", "pm.globals.set('commentId', comment.id);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "body": { "mode": "raw", "raw": "{\"comment\":{\"body\":\"Before starting a new implementation, please check if there is any work in progress for the stack you want to work on.\"}}" }, "url": { "raw": "{{APIURL}}/articles/{{slug}}/comments", "host": [ "{{APIURL}}" ], "path": [ "articles", "{{slug}}", "comments" ] } }, "response": [] }, { "name": "Create Comment #2 for Article #3", "event": [ { "listen": "test", "script": { "exec": [ "var responseJSON = JSON.parse(responseBody);", "", "tests['Response contains \"comment\" property'] = responseJSON.hasOwnProperty('comment');", "", "var comment = responseJSON.comment || {};", "", "tests['Comment has \"id\" property'] = comment.hasOwnProperty('id');", "pm.globals.set('commentId', comment.id);", "" ], "type": "text/javascript" } } ], "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "body": { "mode": "raw", "raw": "{\"comment\":{\"body\":\"If someone else has started working on an implementation, consider jumping in and helping them! by contacting the author.\"}}" }, "url": { "raw": "{{APIURL}}/articles/{{slug}}/comments", "host": [ "{{APIURL}}" ], "path": [ "articles", "{{slug}}", "comments" ] } }, "response": [] }, { "name": "All Articles", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "var is200Response = responseCode.code === 200;", "", "tests['Response code is 200 OK'] = is200Response;", "", "if(is200Response){", " var responseJSON = JSON.parse(responseBody);", "", " tests['Response contains \"articles\" property'] = responseJSON.hasOwnProperty('articles');", " tests['Response contains \"articlesCount\" property'] = responseJSON.hasOwnProperty('articlesCount');", " tests['articlesCount is an integer'] = Number.isInteger(responseJSON.articlesCount);", "", " if(responseJSON.articles.length){", " var article = responseJSON.articles[0];", " } else {", " tests['articlesCount is 0 when feed is empty'] = responseJSON.articlesCount === 0;", " }", "}", "" ] } } ], "request": { "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "url": { "raw": "{{APIURL}}/articles", "host": [ "{{APIURL}}" ], "path": [ "articles" ] } }, "response": [] }, { "name": "All Comments for Article", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": [ "var is200Response = responseCode.code === 200", "", "tests['Response code is 200 OK'] = is200Response;", "", "if(is200Response){", " var responseJSON = JSON.parse(responseBody);", "", " tests['Response contains \"comments\" property'] = responseJSON.hasOwnProperty('comments');", "", " if(responseJSON.comments.length){", " var comment = responseJSON.comments[0];", " }", "}", "" ] } } ], "request": { "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "X-Requested-With", "value": "XMLHttpRequest" }, { "key": "Authorization", "value": "Token {{token}}" } ], "url": { "raw": "{{APIURL}}/articles/{{slug}}/comments", "host": [ "{{APIURL}}" ], "path": [ "articles", "{{slug}}", "comments" ] } }, "response": [] } ] } ] }