{"action":"created","comment":{"url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/comments/198778027","pull_request_review_id":132766611,"id":198778027,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODc3ODAyNw==","diff_hunk":"@@ -0,0 +1,65 @@\n+\"\"\"\n+This file holds user login test cases.\n+\"\"\"\n+import unittest\n+import json\n+from api import create_app\n+\n+\n+class AuthTestCase(unittest.TestCase):\n+    \"\"\"\n+        Test case for User login.\n+    \"\"\"\n+\n+    def setUp(self):\n+        \"\"\"Set up test variables.\"\"\"\n+        self.app = create_app(config_name=\"testing\")\n+        # initialize the test client\n+        self.client = self.app.test_client\n+        # This is the user test json data with a predefined email and password\n+        self.user_data = {\n+            'user_email': 'jimmy@example.com',\n+            'password': 'test_123'\n+        }\n+        self.user_data_log = {\n+            'user_email': 'kennedy@example.com',\n+            'password': 'test_123'\n+        }\n+        self.not_a_user = {\n+            'user_email': 'abela@test.com',\n+            'password': 'nopekabisa'\n+        }\n+\n+    def test_user_login(self):\n+        \"\"\"Test signed up user can login.\"\"\"\n+        response = self.client().post('/api/v1/auth/signup', data=self.user_data_log)\n+        self.assertEqual(response.status_code, 201)\n+        login_response = self.client().post('/api/v1/auth/login', data=self.user_data_log)\n+        #assert that the status code is equal to 200\n+        self.assertEqual(login_response.status_code, 200)\n+        #return result in json format\n+        result = json.loads(login_response.data.decode())\n+        #test that the response contains success message\n+        self.assertEqual(result[\"message\"],\n+                         \"You have successfully logged in!.\")\n+        self.assertTrue(result[\"access_token\"])\n+\n+    def test_non_registered_user_login(self):\n+        \"\"\"Test non registered users cannot login.\"\"\"\n+        response = self.client().post('/api/v1/auth/signup', data=self.user_data)","path":"tests/test_user_login.py","position":49,"original_position":49,"commit_id":"2747710763cbd55e47e03ac3b736d90a2b00856d","original_commit_id":"2747710763cbd55e47e03ac3b736d90a2b00856d","user":{"login":"Ogollah","id":30415974,"node_id":"MDQ6VXNlcjMwNDE1OTc0","avatar_url":"https://avatars2.githubusercontent.com/u/30415974?v=4","gravatar_id":"","url":"https://api.github.com/users/Ogollah","html_url":"https://github.com/Ogollah","followers_url":"https://api.github.com/users/Ogollah/followers","following_url":"https://api.github.com/users/Ogollah/following{/other_user}","gists_url":"https://api.github.com/users/Ogollah/gists{/gist_id}","starred_url":"https://api.github.com/users/Ogollah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ogollah/subscriptions","organizations_url":"https://api.github.com/users/Ogollah/orgs","repos_url":"https://api.github.com/users/Ogollah/repos","events_url":"https://api.github.com/users/Ogollah/events{/privacy}","received_events_url":"https://api.github.com/users/Ogollah/received_events","type":"User","site_admin":false},"body":"It is used to test unregistered user. in that we first signup a user and then try to login with a different data set. ","created_at":"2018-06-28T09:37:40Z","updated_at":"2018-06-28T09:37:40Z","html_url":"https://github.com/Ogollah/Ride-my-way-api/pull/4#discussion_r198778027","pull_request_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/4","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/comments/198778027"},"html":{"href":"https://github.com/Ogollah/Ride-my-way-api/pull/4#discussion_r198778027"},"pull_request":{"href":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/4"}},"in_reply_to_id":198758073},"pull_request":{"url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/4","id":197611096,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3NjExMDk2","html_url":"https://github.com/Ogollah/Ride-my-way-api/pull/4","diff_url":"https://github.com/Ogollah/Ride-my-way-api/pull/4.diff","patch_url":"https://github.com/Ogollah/Ride-my-way-api/pull/4.patch","issue_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues/4","number":4,"state":"open","locked":false,"title":"Develop","user":{"login":"Ogollah","id":30415974,"node_id":"MDQ6VXNlcjMwNDE1OTc0","avatar_url":"https://avatars2.githubusercontent.com/u/30415974?v=4","gravatar_id":"","url":"https://api.github.com/users/Ogollah","html_url":"https://github.com/Ogollah","followers_url":"https://api.github.com/users/Ogollah/followers","following_url":"https://api.github.com/users/Ogollah/following{/other_user}","gists_url":"https://api.github.com/users/Ogollah/gists{/gist_id}","starred_url":"https://api.github.com/users/Ogollah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ogollah/subscriptions","organizations_url":"https://api.github.com/users/Ogollah/orgs","repos_url":"https://api.github.com/users/Ogollah/repos","events_url":"https://api.github.com/users/Ogollah/events{/privacy}","received_events_url":"https://api.github.com/users/Ogollah/received_events","type":"User","site_admin":false},"body":"#### What does this Pr do?\r\ncomplete challenge 2\r\n#### Description of Task to be completed?\r\nExpects working and test endpoint\r\n`POST/auth/signup`\r\n `POST/auth/login`\r\n `POST/auth/logout`\r\n `POST/ride/create`\r\n `GET /ride/rides`    \r\n `GET /ride/<rideId>`  \r\n `POST /rides/<rideId>/requests`  \r\n#### How should this be manually tested?\r\n`usingterminal`\r\n [clone this repo](https://github.com/Ogollah/Ride-my-way-api.git)\r\n`cd Ride-my-way-api`\r\n`set and activate your virtual environment`\r\n`git checkout develop`\r\n`Run nosetests`\r\n### What are the relevant pivotal tracker stories?\r\n[Pivotal Tracker](https://www.pivotaltracker.com/n/projects/2179573)\r\n#### Screenshots\r\n\r\n![signup](https://user-images.githubusercontent.com/30415974/41955881-8c67e74e-79ea-11e8-9797-064abd4953e3.png)\r\n![login](https://user-images.githubusercontent.com/30415974/41955887-92b1c0e8-79ea-11e8-9ad9-0c3477194b8a.png)\r\n![get rides](https://user-images.githubusercontent.com/30415974/41955916-9aeb66ba-79ea-11e8-81ef-d74b976f09fd.png)\r\n\r\n","created_at":"2018-06-27T04:05:41Z","updated_at":"2018-06-28T09:37:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0d576136ed1db83c081bb6d88787abd7cf25b5d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/4/commits","review_comments_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/4/comments","review_comment_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues/4/comments","statuses_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/statuses/2747710763cbd55e47e03ac3b736d90a2b00856d","head":{"label":"Ogollah:develop","ref":"develop","sha":"2747710763cbd55e47e03ac3b736d90a2b00856d","user":{"login":"Ogollah","id":30415974,"node_id":"MDQ6VXNlcjMwNDE1OTc0","avatar_url":"https://avatars2.githubusercontent.com/u/30415974?v=4","gravatar_id":"","url":"https://api.github.com/users/Ogollah","html_url":"https://github.com/Ogollah","followers_url":"https://api.github.com/users/Ogollah/followers","following_url":"https://api.github.com/users/Ogollah/following{/other_user}","gists_url":"https://api.github.com/users/Ogollah/gists{/gist_id}","starred_url":"https://api.github.com/users/Ogollah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ogollah/subscriptions","organizations_url":"https://api.github.com/users/Ogollah/orgs","repos_url":"https://api.github.com/users/Ogollah/repos","events_url":"https://api.github.com/users/Ogollah/events{/privacy}","received_events_url":"https://api.github.com/users/Ogollah/received_events","type":"User","site_admin":false},"repo":{"id":138610569,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg2MTA1Njk=","name":"Ride-my-way-api","full_name":"Ogollah/Ride-my-way-api","owner":{"login":"Ogollah","id":30415974,"node_id":"MDQ6VXNlcjMwNDE1OTc0","avatar_url":"https://avatars2.githubusercontent.com/u/30415974?v=4","gravatar_id":"","url":"https://api.github.com/users/Ogollah","html_url":"https://github.com/Ogollah","followers_url":"https://api.github.com/users/Ogollah/followers","following_url":"https://api.github.com/users/Ogollah/following{/other_user}","gists_url":"https://api.github.com/users/Ogollah/gists{/gist_id}","starred_url":"https://api.github.com/users/Ogollah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ogollah/subscriptions","organizations_url":"https://api.github.com/users/Ogollah/orgs","repos_url":"https://api.github.com/users/Ogollah/repos","events_url":"https://api.github.com/users/Ogollah/events{/privacy}","received_events_url":"https://api.github.com/users/Ogollah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ogollah/Ride-my-way-api","description":null,"fork":false,"url":"https://api.github.com/repos/Ogollah/Ride-my-way-api","forks_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/forks","keys_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/teams","hooks_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/hooks","issue_events_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues/events{/number}","events_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/events","assignees_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/assignees{/user}","branches_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/branches{/branch}","tags_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/tags","blobs_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/statuses/{sha}","languages_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/languages","stargazers_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/stargazers","contributors_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/contributors","subscribers_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/subscribers","subscription_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/subscription","commits_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/contents/{+path}","compare_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/merges","archive_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/downloads","issues_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues{/number}","pulls_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls{/number}","milestones_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/milestones{/number}","notifications_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/labels{/name}","releases_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/releases{/id}","deployments_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/deployments","created_at":"2018-06-25T15:01:36Z","updated_at":"2018-06-27T06:36:34Z","pushed_at":"2018-06-28T07:38:55Z","git_url":"git://github.com/Ogollah/Ride-my-way-api.git","ssh_url":"git@github.com:Ogollah/Ride-my-way-api.git","clone_url":"https://github.com/Ogollah/Ride-my-way-api.git","svn_url":"https://github.com/Ogollah/Ride-my-way-api","homepage":null,"size":69,"stargazers_count":0,"watchers_count":0,"language":"API Blueprint","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Ogollah:master","ref":"master","sha":"9ecc50c38ab72f77304424aa35c177a4caa75a06","user":{"login":"Ogollah","id":30415974,"node_id":"MDQ6VXNlcjMwNDE1OTc0","avatar_url":"https://avatars2.githubusercontent.com/u/30415974?v=4","gravatar_id":"","url":"https://api.github.com/users/Ogollah","html_url":"https://github.com/Ogollah","followers_url":"https://api.github.com/users/Ogollah/followers","following_url":"https://api.github.com/users/Ogollah/following{/other_user}","gists_url":"https://api.github.com/users/Ogollah/gists{/gist_id}","starred_url":"https://api.github.com/users/Ogollah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ogollah/subscriptions","organizations_url":"https://api.github.com/users/Ogollah/orgs","repos_url":"https://api.github.com/users/Ogollah/repos","events_url":"https://api.github.com/users/Ogollah/events{/privacy}","received_events_url":"https://api.github.com/users/Ogollah/received_events","type":"User","site_admin":false},"repo":{"id":138610569,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg2MTA1Njk=","name":"Ride-my-way-api","full_name":"Ogollah/Ride-my-way-api","owner":{"login":"Ogollah","id":30415974,"node_id":"MDQ6VXNlcjMwNDE1OTc0","avatar_url":"https://avatars2.githubusercontent.com/u/30415974?v=4","gravatar_id":"","url":"https://api.github.com/users/Ogollah","html_url":"https://github.com/Ogollah","followers_url":"https://api.github.com/users/Ogollah/followers","following_url":"https://api.github.com/users/Ogollah/following{/other_user}","gists_url":"https://api.github.com/users/Ogollah/gists{/gist_id}","starred_url":"https://api.github.com/users/Ogollah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ogollah/subscriptions","organizations_url":"https://api.github.com/users/Ogollah/orgs","repos_url":"https://api.github.com/users/Ogollah/repos","events_url":"https://api.github.com/users/Ogollah/events{/privacy}","received_events_url":"https://api.github.com/users/Ogollah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ogollah/Ride-my-way-api","description":null,"fork":false,"url":"https://api.github.com/repos/Ogollah/Ride-my-way-api","forks_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/forks","keys_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/teams","hooks_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/hooks","issue_events_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues/events{/number}","events_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/events","assignees_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/assignees{/user}","branches_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/branches{/branch}","tags_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/tags","blobs_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/statuses/{sha}","languages_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/languages","stargazers_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/stargazers","contributors_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/contributors","subscribers_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/subscribers","subscription_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/subscription","commits_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/contents/{+path}","compare_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/merges","archive_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/downloads","issues_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues{/number}","pulls_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls{/number}","milestones_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/milestones{/number}","notifications_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/labels{/name}","releases_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/releases{/id}","deployments_url":"https://api.github.com/repos/Ogollah/Ride-my-way-api/deployments","created_at":"2018-06-25T15:01:36Z","updated_at":"2018-06-27T06:36:34Z","pushed_at":"2018-06-28T07:38:55Z","git_url":"git://github.com/Ogollah/Ride-my-way-api.git","ssh_url":"git@github.com:Ogollah/Ride-my-way-api.git","clone_url":"https://github.com/Ogollah/Ride-my-way-api.git","svn_url":"https://github.com/Ogollah/Ride-my-way-api","homepage":null,"size":69,"stargazers_count":0,"watchers_count":0,"language":"API Blueprint","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/4"},"html":{"href":"https://github.com/Ogollah/Ride-my-way-api/pull/4"},"issue":{"href":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues/4"},"comments":{"href":"https://api.github.com/repos/Ogollah/Ride-my-way-api/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ogollah/Ride-my-way-api/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/Ogollah/Ride-my-way-api/statuses/2747710763cbd55e47e03ac3b736d90a2b00856d"}},"author_association":"OWNER"}}
{"actor":{"display_login":"Ogollah"}}