{"info":{"_postman_id":"3e226695-958b-be2d-4262-c41cdf635a21","name":"Realworld API","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"1841370","collectionId":"3e226695-958b-be2d-4262-c41cdf635a21","publishedId":"7TFGFZA","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2018-01-15T17:03:36.000Z"},"item":[{"name":"Ping","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","tests['should have pong field'] = res.pong;",""]}}],"id":"c285cbe5-63ce-91c2-7cab-74dee9c0fa6a","request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/ping","urlObject":{"path":["ping"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"c285cbe5-63ce-91c2-7cab-74dee9c0fa6a"},{"name":"Clean Slate","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;",""]}}],"id":"12d6cff3-3767-dbd5-446d-e53115de99c1","request":{"method":"PURGE","header":[],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/__DELETE_ALL_DATA__","urlObject":{"path":["__DELETE_ALL_DATA__"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"12d6cff3-3767-dbd5-446d-e53115de99c1"},{"name":"CORS Options","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;",""]}}],"id":"6d3ba54f-1232-4c7d-73d7-479ba2202187","request":{"method":"OPTIONS","header":[],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/anything/really","urlObject":{"path":["anything","really"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6d3ba54f-1232-4c7d-73d7-479ba2202187"},{"name":"Signup","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","tests['should have user field'] = typeof(res.user) === 'object';","var user = res.user;","","var expectedUserFields = ['email', 'token', 'username', 'bio', 'image'];","expectedUserFields.forEach(function(key) {","    tests[`user should have ${key} field`] = (typeof(user[key]) !== 'undefined');","});","tests['should have correct email'] = user.email == 'basicuser@mail.com';","tests['should have correct username'] = user.username == 'basicuser';",""]}}],"id":"1f30f852-de00-ec81-25a8-2303424d7ba7","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user\": {\n    \"username\": \"basicuser\",\n    \"email\": \"basicuser@mail.com\",\n    \"password\": \"password\"\n  }\n}"},"url":"{{apiUrl}}/users","urlObject":{"path":["users"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1f30f852-de00-ec81-25a8-2303424d7ba7"},{"name":"Signup Another User","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","tests['should have user field'] = typeof(res.user) === 'object';","var user = res.user;","","var expectedUserFields = ['email', 'token', 'username', 'bio', 'image'];","expectedUserFields.forEach(function(key) {","    tests[`user should have ${key} field`] = (typeof(user[key]) !== 'undefined');","});","tests['should have correct email'] = user.email == 'celebuser@mail.com';","tests['should have correct username'] = user.username == 'celebuser';",""]}}],"id":"cf7f7b86-7d01-e676-3edf-c88dd301bbbd","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user\": {\n    \"username\": \"celebuser\",\n    \"email\": \"celebuser@mail.com\",\n    \"password\": \"password\"\n  }\n}"},"url":"{{apiUrl}}/users","urlObject":{"path":["users"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"cf7f7b86-7d01-e676-3edf-c88dd301bbbd"},{"name":"Login","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","tests['should have user field'] = typeof(res.user) === 'object';","var user = res.user;","","var expectedUserFields = ['email', 'token', 'username', 'bio', 'image'];","expectedUserFields.forEach(function(key) {","    tests[`user should have ${key} field`] = (typeof(user[key]) !== 'undefined');","});","tests['should have correct email'] = user.email == 'basicuser@mail.com';","tests['should have correct username'] = user.username == 'basicuser';","","pm.globals.unset('authToken');","pm.globals.set('authToken', user.token);","tests['global variable token should be set'] = pm.globals.get('authToken');",""]}}],"id":"29075a04-86bb-e953-23c3-e9c2c8d77868","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"user\": {\n    \"email\": \"basicuser@mail.com\",\n    \"password\": \"password\"\n  }\n}"},"url":"{{apiUrl}}/users/login","urlObject":{"path":["users","login"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"29075a04-86bb-e953-23c3-e9c2c8d77868"},{"name":"Authenticate","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","tests['should have user field'] = typeof(res.user) === 'object';","var user = res.user;","","var expectedUserFields = ['email', 'token', 'username', 'bio', 'image'];","expectedUserFields.forEach(function(key) {","    tests[`user should have ${key} field`] = (typeof(user[key]) !== 'undefined');","});","tests['should have correct email'] = user.email == 'basicuser@mail.com';","tests['should have correct username'] = user.username == 'basicuser';",""]}}],"id":"299fce43-193e-b0dd-8ee0-738d530c140f","request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/user","urlObject":{"path":["user"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"299fce43-193e-b0dd-8ee0-738d530c140f"},{"name":"Update User","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","tests['should have user field'] = typeof(res.user) === 'object';","var user = res.user;","","var expectedUserFields = ['email', 'token', 'username', 'bio', 'image'];","expectedUserFields.forEach(function(key) {","    tests[`user should have ${key} field`] = (typeof(user[key]) !== 'undefined');","});","tests['should have correct email'] = user.email == 'newemail@mail.com';","tests['should have correct username'] = user.username == 'basicuser';",""]}}],"id":"6c04a9ee-2d79-6859-c091-4464dbc935e3","request":{"method":"PUT","header":[{"key":"Authorization","value":"Token {{authToken}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"user\": {\n\t\t\"email\": \"newemail@mail.com\"\n\t}\n}"},"url":"{{apiUrl}}/user","urlObject":{"path":["user"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6c04a9ee-2d79-6859-c091-4464dbc935e3"},{"name":"404","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 404'] = pm.response.code === 404;","res = pm.response.json();","console.log(res);","tests['should have correct error message'] = res.errors.body[0].indexOf('404 Not found') > -1;",""]}}],"id":"320c5e51-8510-a969-1e54-b41118b92da6","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/nopez","urlObject":{"path":["nopez"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"320c5e51-8510-a969-1e54-b41118b92da6"},{"name":"Follow","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var profile = res.profile;","tests['should have profile field'] = typeof(profile) === 'object';","var expectedProfileFields = ['username', 'bio', 'image', 'following'];","expectedProfileFields.forEach(function(key) {","    tests[`profile should have ${key} field`] = (typeof(profile[key]) !== 'undefined');","});","tests['should have correct username'] = profile.username === 'celebuser';","tests['should have correct following'] = profile.following === true;",""]}}],"id":"f6e61c54-1766-aa43-5180-0f412292d867","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/profiles/celebuser/follow","urlObject":{"path":["profiles","celebuser","follow"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f6e61c54-1766-aa43-5180-0f412292d867"},{"name":"Profile","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var profile = res.profile;","tests['should have profile field'] = typeof(profile) === 'object';","var expectedProfileFields = ['username', 'bio', 'image', 'following'];","expectedProfileFields.forEach(function(key) {","    tests[`profile should have ${key} field`] = (typeof(profile[key]) !== 'undefined');","});","tests['should have correct username'] = profile.username === 'celebuser';","tests['should have correct following'] = profile.following === true;",""]}}],"id":"13216d97-14ce-12d7-593a-316ee29a1369","request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/profiles/celebuser","urlObject":{"path":["profiles","celebuser"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"13216d97-14ce-12d7-593a-316ee29a1369"},{"name":"Unfollow","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var profile = res.profile;","tests['should have profile field'] = typeof(profile) === 'object';","var expectedProfileFields = ['username', 'bio', 'image', 'following'];","expectedProfileFields.forEach(function(key) {","    tests[`profile should have ${key} field`] = (typeof(profile[key]) !== 'undefined');","});","tests['should have correct username'] = profile.username === 'celebuser';","tests['should have correct following'] = profile.following === false;",""]}}],"id":"2262ad8e-5029-ffb5-24c7-42542304b5fc","request":{"method":"DELETE","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/profiles/celebuser/follow","urlObject":{"path":["profiles","celebuser","follow"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2262ad8e-5029-ffb5-24c7-42542304b5fc"},{"name":"Create Article","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var article = res.article;","tests['should have article field'] = typeof(article) === 'object';","","var expectedArticleFields = ['slug', 'title', 'description', 'body', 'tagList', 'createdAt', 'updatedAt', 'author', 'favorited', 'favoritesCount'];","expectedArticleFields.forEach(function(key) {","    tests[`article should have ${key} field`] = (typeof(article[key]) !== 'undefined');","});","tests['should have correct title'] = article.title === 'How to train your dragon';","tests['should have correct decription'] = article.description === 'Ever wonder how?';","tests['should have correct body'] = article.body === 'You have to believe';","","var author = article.author;","tests['should have author field'] = typeof(author) === 'object';","var expectedAuthorFields = ['username', 'bio', 'image', 'following'];","expectedAuthorFields.forEach(function(key) {","    tests[`author should have ${key} field`] = (typeof(author[key]) !== 'undefined');","});","tests['author username should be correct'] = author.username === 'basicuser';","","pm.globals.unset('articleSlug');","pm.globals.set('articleSlug', article.slug);","tests['global variable articleSlug should be set'] = pm.globals.get('articleSlug');",""]}}],"id":"feed63c7-e97d-0d61-40a7-1df25ea22a10","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":"{\n  \"article\": {\n    \"title\": \"How to train your dragon\",\n    \"description\": \"Ever wonder how?\",\n    \"body\": \"You have to believe\",\n    \"tagList\": [\"reactjs\", \"angularjs\", \"dragons\"]\n  }\n}"},"url":"{{apiUrl}}/articles","urlObject":{"path":["articles"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"feed63c7-e97d-0d61-40a7-1df25ea22a10"},{"name":"Get Article","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var article = res.article;","tests['should have article field'] = typeof(article) === 'object';","","var expectedArticleFields = ['slug', 'title', 'description', 'body', 'tagList', 'createdAt', 'updatedAt', 'author', 'favorited', 'favoritesCount'];","expectedArticleFields.forEach(function(key) {","    tests[`article should have ${key} field`] = (typeof(article[key]) !== 'undefined');","});","tests['should have correct title'] = article.title === 'How to train your dragon';","tests['should have correct decription'] = article.description === 'Ever wonder how?';","tests['should have correct body'] = article.body === 'You have to believe';","","var author = article.author;","tests['should have author field'] = typeof(author) === 'object';","var expectedAuthorFields = ['username', 'bio', 'image', 'following'];","expectedAuthorFields.forEach(function(key) {","    tests[`author should have ${key} field`] = (typeof(author[key]) !== 'undefined');","});","tests['author username should be correct'] = author.username === 'basicuser';",""]}}],"id":"05968198-dec5-1ddb-4767-98b06c6c83cb","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles/{{articleSlug}}","urlObject":{"path":["articles","{{articleSlug}}"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"05968198-dec5-1ddb-4767-98b06c6c83cb"},{"name":"Update Article","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var article = res.article;","tests['should have article field'] = typeof(article) === 'object';","","var expectedArticleFields = ['slug', 'title', 'description', 'body', 'tagList', 'createdAt', 'updatedAt', 'author', 'favorited', 'favoritesCount'];","expectedArticleFields.forEach(function(key) {","    tests[`article should have ${key} field`] = (typeof(article[key]) !== 'undefined');","});","tests['should have correct title'] = article.title === 'new title';","tests['should have correct decription'] = article.description === 'new description';","tests['should have correct body'] = article.body === 'new body';","","var author = article.author;","tests['should have author field'] = typeof(author) === 'object';","var expectedAuthorFields = ['username', 'bio', 'image', 'following'];","expectedAuthorFields.forEach(function(key) {","    tests[`author should have ${key} field`] = (typeof(author[key]) !== 'undefined');","});","tests['author username should be correct'] = author.username === 'basicuser';",""]}}],"id":"56f5c6fc-fdff-fa76-09b7-182f20c1a9e3","request":{"method":"PUT","header":[{"key":"Authorization","value":"Token {{authToken}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"article\": {\n\t\t\"title\": \"new title\",\n\t\t\"description\": \"new description\",\n\t\t\"body\": \"new body\"\n\t}\n}"},"url":"{{apiUrl}}/articles/{{articleSlug}}","urlObject":{"path":["articles","{{articleSlug}}"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"56f5c6fc-fdff-fa76-09b7-182f20c1a9e3"},{"name":"Get All Articles","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var articles = res.articles;","tests['should have articles field'] = typeof(articles) === 'object';","tests['should have articlesCount field'] = typeof(res.articlesCount) !== 'undefined';","",""]}}],"id":"b800734e-e706-7aa4-d2cf-e52a4aadc6c1","request":{"method":"GET","header":[{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles","urlObject":{"path":["articles"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b800734e-e706-7aa4-d2cf-e52a4aadc6c1"},{"name":"Get All Articles Limit","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var articles = res.articles;","tests['should have articles field'] = typeof(articles) === 'object';","tests['should have articlesCount field'] = typeof(res.articlesCount) !== 'undefined';","",""]}}],"id":"75f3f889-807f-9dc6-2f73-bc75a7f5fd23","request":{"method":"GET","header":[{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles?limit=1","urlObject":{"path":["articles"],"host":["{{apiUrl}}"],"query":[{"key":"limit","value":"1"}],"variable":[]}},"response":[],"_postman_id":"75f3f889-807f-9dc6-2f73-bc75a7f5fd23"},{"name":"Get All Articles Offset","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var articles = res.articles;","tests['should have articles field'] = typeof(articles) === 'object';","tests['should have articlesCount field'] = typeof(res.articlesCount) !== 'undefined';","",""]}}],"id":"37ce136a-5ec9-bd19-2fa6-29899223ea87","request":{"method":"GET","header":[{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles?offset=1","urlObject":{"path":["articles"],"host":["{{apiUrl}}"],"query":[{"key":"offset","value":"1"}],"variable":[]}},"response":[],"_postman_id":"37ce136a-5ec9-bd19-2fa6-29899223ea87"},{"name":"Get All Articles by Tag","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var articles = res.articles;","tests['should have articles field'] = typeof(articles) === 'object';","tests['should have articlesCount field'] = typeof(res.articlesCount) !== 'undefined';","",""]}}],"id":"5097caa7-e9a8-8435-b70e-21cf69b6956c","request":{"method":"GET","header":[{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles?tag=dragons","urlObject":{"path":["articles"],"host":["{{apiUrl}}"],"query":[{"key":"tag","value":"dragons"}],"variable":[]}},"response":[],"_postman_id":"5097caa7-e9a8-8435-b70e-21cf69b6956c"},{"name":"Get All Articles by Author","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var articles = res.articles;","tests['should have articles field'] = typeof(articles) === 'object';","tests['should have articlesCount field'] = typeof(res.articlesCount) !== 'undefined';","",""]}}],"id":"e3ff4c69-141f-59a2-4e02-4cae897f7303","request":{"method":"GET","header":[{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles?author=basicuser","urlObject":{"path":["articles"],"host":["{{apiUrl}}"],"query":[{"key":"author","value":"basicuser"}],"variable":[]}},"response":[],"_postman_id":"e3ff4c69-141f-59a2-4e02-4cae897f7303"},{"name":"Get All Articles by Favorited","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var articles = res.articles;","tests['should have articles field'] = typeof(articles) === 'object';","tests['should have articlesCount field'] = typeof(res.articlesCount) !== 'undefined';","",""]}}],"id":"7427e960-be16-3458-a53b-d80a55e161c9","request":{"method":"GET","header":[{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles?favorited=basicuser","urlObject":{"path":["articles"],"host":["{{apiUrl}}"],"query":[{"key":"favorited","value":"basicuser"}],"variable":[]}},"response":[],"_postman_id":"7427e960-be16-3458-a53b-d80a55e161c9"},{"name":"Feed","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var articles = res.articles;","tests['should have articles field'] = typeof(articles) === 'object';","tests['should have articlesCount field'] = typeof(res.articlesCount) !== 'undefined';",""]}}],"id":"25a00dd3-3f6a-4e1f-0a02-5ba05a1f6fdb","request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles/feed","urlObject":{"path":["articles","feed"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"25a00dd3-3f6a-4e1f-0a02-5ba05a1f6fdb"},{"name":"Feed with Limit","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var articles = res.articles;","tests['should have articles field'] = typeof(articles) === 'object';","tests['should have articlesCount field'] = typeof(res.articlesCount) !== 'undefined';",""]}}],"id":"1c22680a-d503-a0a4-67c5-9583268ceee4","request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles/feed?limit=1","urlObject":{"path":["articles","feed"],"host":["{{apiUrl}}"],"query":[{"key":"limit","value":"1"}],"variable":[]}},"response":[],"_postman_id":"1c22680a-d503-a0a4-67c5-9583268ceee4"},{"name":"Feed with Offset","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var articles = res.articles;","tests['should have articles field'] = typeof(articles) === 'object';","tests['should have articlesCount field'] = typeof(res.articlesCount) !== 'undefined';",""]}}],"id":"9b078b5a-0392-bf8b-fae4-15419b4b0d79","request":{"method":"GET","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles/feed?offset=1","urlObject":{"path":["articles","feed"],"host":["{{apiUrl}}"],"query":[{"key":"offset","value":"1"}],"variable":[]}},"response":[],"_postman_id":"9b078b5a-0392-bf8b-fae4-15419b4b0d79"},{"name":"Add Comment","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","console.log(res);","var comment = res.comment;","tests['should have comment field'] = typeof(comment) === 'object';","","var expectedCommentFields = ['body', 'createdAt', 'updatedAt', 'author', 'id'];","expectedCommentFields.forEach(function(key) {","    tests[`comment should have ${key} field`] = (typeof(comment[key]) !== 'undefined');","});","tests['should have correct body'] = comment.body === 'His name was my name too.';","","var author = comment.author;","tests['should have author field'] = typeof(author) === 'object';","var expectedAuthorFields = ['username', 'bio', 'image', 'following'];","expectedAuthorFields.forEach(function(key) {","    tests[`author should have ${key} field`] = (typeof(author[key]) !== 'undefined');","});","tests['author username should be correct'] = author.username === 'basicuser';","","pm.globals.unset('commentId');","pm.globals.set('commentId', comment.id);","tests['global variable commentId should be set'] = pm.globals.get('commentId');",""]}}],"id":"7e53e619-6733-b472-184f-ee4fda927715","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":"{\n  \"comment\": {\n    \"body\": \"His name was my name too.\"\n  }\n}"},"url":"{{apiUrl}}/articles/{{articleSlug}}/comments","urlObject":{"path":["articles","{{articleSlug}}","comments"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7e53e619-6733-b472-184f-ee4fda927715"},{"name":"Get Comments","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","var comments = res.comments;","tests['should have comments field'] = Array.isArray(comments);","",""]}}],"id":"bd64c7c7-a4a1-a401-fd3a-091181dc8c80","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles/{{articleSlug}}/comments","urlObject":{"path":["articles","{{articleSlug}}","comments"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"bd64c7c7-a4a1-a401-fd3a-091181dc8c80"},{"name":"Delete Comment","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;",""]}}],"id":"1313a104-d1c1-213d-338e-191c4de06d75","request":{"method":"DELETE","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles/{{articleSlug}}/comments/{{commentId}}","urlObject":{"path":["articles","{{articleSlug}}","comments","{{commentId}}"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1313a104-d1c1-213d-338e-191c4de06d75"},{"name":"Favorite Article","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","var article = res.article;","tests['should have article field'] = typeof(res.article) !== 'undefined';","tests['should be favorited'] = article.favorited === true;","tests['should have favoritesCount of one'] = article.favoritesCount === 1;",""]}}],"id":"616da9db-d70c-ca7f-9527-f7062d57c847","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles/{{articleSlug}}/favorite","urlObject":{"path":["articles","{{articleSlug}}","favorite"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"616da9db-d70c-ca7f-9527-f7062d57c847"},{"name":"Unfavorite Article","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","var article = res.article;","tests['should have article field'] = typeof(res.article) !== 'undefined';","tests['should not be favorited'] = article.favorited === false;","tests['should have favoritesCount of zero'] = article.favoritesCount === 0;",""]}}],"id":"da4e693f-6f92-a099-66f2-b4c78d1fac62","request":{"method":"DELETE","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles/{{articleSlug}}/favorite","urlObject":{"path":["articles","{{articleSlug}}","favorite"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"da4e693f-6f92-a099-66f2-b4c78d1fac62"},{"name":"Get All Tags","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;","res = pm.response.json();","var tags = res.tags;","tests['should have tags field'] = typeof(tags) !== 'undefined';","tests['tags should be an array'] = Array.isArray(tags);",""]}}],"id":"bdac6e47-d36f-7e03-874a-fc289b4e9f9b","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/tags","urlObject":{"path":["tags"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"bdac6e47-d36f-7e03-874a-fc289b4e9f9b"},{"name":"Delete Article","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;",""]}}],"id":"7fa7bb28-10de-32b8-c38d-cc6f81247bac","request":{"method":"DELETE","header":[{"key":"Authorization","value":"Token {{authToken}}"}],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/articles/{{articleSlug}}","urlObject":{"path":["articles","{{articleSlug}}"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7fa7bb28-10de-32b8-c38d-cc6f81247bac"},{"name":"Clean Slate","event":[{"listen":"test","script":{"type":"text/javascript","exec":["tests['should have status 200'] = pm.response.code === 200;",""]}}],"id":"ca047155-7a15-853e-fbda-dcbb6c78037e","request":{"method":"PURGE","header":[],"body":{"mode":"raw","raw":""},"url":"{{apiUrl}}/__DELETE_ALL_DATA__","urlObject":{"path":["__DELETE_ALL_DATA__"],"host":["{{apiUrl}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ca047155-7a15-853e-fbda-dcbb6c78037e"}]}