{"action":"created","comment":{"url":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/comments/227493804","pull_request_review_id":167542317,"id":227493804,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzQ5MzgwNA==","diff_hunk":"@@ -0,0 +1,58 @@\n+require \"test_helper\"\n+\n+describe Work do\n+  let(:ten) {works(:ten)}\n+  let(:fire) {works(:fire)}\n+  let (:vale) {works(:vale)}\n+\n+\n+  it \"must be valid if all params are filled correctly\" do\n+    expect(ten.valid?).must_equal true\n+  end\n+\n+  it \"must have a title\" do\n+    ten.title = nil\n+    expect(ten.valid?).must_equal false\n+    expect(ten.errors.messages).must_include :title\n+  end\n+\n+  it \"must have a publication_year\" do\n+    fire.publication_year = nil\n+    expect(fire.valid?).must_equal false\n+    expect(fire.errors.messages).must_include :publication_year\n+  end\n+\n+  it \"must have a publication_year that is year between now and the year 1000\" do\n+    fire.publication_year = \"year\"\n+    expect(fire.valid?).must_equal false\n+\n+    fire.publication_year = 5\n+    expect(fire.valid?).must_equal false\n+\n+    fire.publication_year = 1984\n+    expect(fire.valid?).must_equal true\n+\n+    fire.publication_year = 7777\n+    expect(fire.valid?).must_equal false\n+  end\n+\n+  describe \"uniqueness of works in a given category\" do\n+  it \"must not allow the same name in a category\" do\n+    duplicate = Work.new(title: vale.title, category: vale.category, creator: \"someone\", publication_year: 1988, description: \"whatever\")\n+    expect(duplicate.valid?).must_equal false\n+  end\n+  it \"must allow the same name in a different category\" do\n+    duplicate = Work.new(title: vale.title, category: ten.category, creator: \"someone\", publication_year: 1988, description: \"whatever\")\n+    expect(duplicate.valid?).must_equal true\n+  end\n+  end\n+\n+  describe \"sorting methods\" do\n+    it \"puts the media in the correct category\" do\n+      expect(Work.movies).must_include fire\n+      expect(Work.albums).must_include ten\n+      expect(Work.books).must_include vale\n+","path":"test/models/work_test.rb","position":55,"original_position":55,"commit_id":"cf95b980337fd96799c400a690ebb75719c02e27","original_commit_id":"cf95b980337fd96799c400a690ebb75719c02e27","user":{"login":"dHelmgren","id":5455308,"node_id":"MDQ6VXNlcjU0NTUzMDg=","avatar_url":"https://avatars0.githubusercontent.com/u/5455308?v=4","gravatar_id":"","url":"https://api.github.com/users/dHelmgren","html_url":"https://github.com/dHelmgren","followers_url":"https://api.github.com/users/dHelmgren/followers","following_url":"https://api.github.com/users/dHelmgren/following{/other_user}","gists_url":"https://api.github.com/users/dHelmgren/gists{/gist_id}","starred_url":"https://api.github.com/users/dHelmgren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dHelmgren/subscriptions","organizations_url":"https://api.github.com/users/dHelmgren/orgs","repos_url":"https://api.github.com/users/dHelmgren/repos","events_url":"https://api.github.com/users/dHelmgren/events{/privacy}","received_events_url":"https://api.github.com/users/dHelmgren/received_events","type":"User","site_admin":false},"body":"There's a lot of interesting test cases for your custom `Work` methods missing here. For `top_work`, I would wonder:\r\n\r\n- What happens if there are no works?\r\n- What happens if there are works but no votes?\r\n- What happens if two works have the same number of votes?\r\n\r\nSimilarly for you category and top ten methods, I would ask:\r\n\r\n- What if there are no works of that category?\r\n- What if there are less than 10 works?\r\n- What if there's a tie for last place, e.g. works 9, 10 and 11 all have 0 votes?\r\n","created_at":"2018-10-23T17:37:16Z","updated_at":"2018-10-23T17:53:05Z","html_url":"https://github.com/Ada-C10/MediaRanker/pull/14#discussion_r227493804","pull_request_url":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/14","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/comments/227493804"},"html":{"href":"https://github.com/Ada-C10/MediaRanker/pull/14#discussion_r227493804"},"pull_request":{"href":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/14","id":222742732,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNzQyNzMy","html_url":"https://github.com/Ada-C10/MediaRanker/pull/14","diff_url":"https://github.com/Ada-C10/MediaRanker/pull/14.diff","patch_url":"https://github.com/Ada-C10/MediaRanker/pull/14.patch","issue_url":"https://api.github.com/repos/Ada-C10/MediaRanker/issues/14","number":14,"state":"open","locked":false,"title":"KTJ's Media Ranker","user":{"login":"katietj","id":25754627,"node_id":"MDQ6VXNlcjI1NzU0NjI3","avatar_url":"https://avatars0.githubusercontent.com/u/25754627?v=4","gravatar_id":"","url":"https://api.github.com/users/katietj","html_url":"https://github.com/katietj","followers_url":"https://api.github.com/users/katietj/followers","following_url":"https://api.github.com/users/katietj/following{/other_user}","gists_url":"https://api.github.com/users/katietj/gists{/gist_id}","starred_url":"https://api.github.com/users/katietj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katietj/subscriptions","organizations_url":"https://api.github.com/users/katietj/orgs","repos_url":"https://api.github.com/users/katietj/repos","events_url":"https://api.github.com/users/katietj/events{/privacy}","received_events_url":"https://api.github.com/users/katietj/received_events","type":"User","site_admin":false},"body":"# Media Ranker\r\nCongratulations! You're submitting your assignment!\r\n\r\n## Comprehension Questions\r\nQuestion | Answer\r\n---      | ---\r\nDescribe a custom model method you wrote. | I wrote model methods to separate the works into the different works categories. These methods also rank them by how many votes they each have, I reverse this ranking so that the works with the most votes are displayed first. \r\nDescribe how you approached testing that model method. What edge cases did you come up with? | I tested this method by making sure that the works went into the category they were assigned at creation. Edge cases were hard for this, because I don't give the user an option to ever make a work without a valid category due to using a drop down menu at work creation. \r\nWhat are `session` and `flash`? What is the difference between them? | Flash is a message that is shown one time in the browser view, usually to tell the user that some action was successful or unsuccessful. A session is a hash-like object that stores information about the current logged in user. Session information goes away after a browser is closed, but a Flash message goes away after the next request-response cycle.\r\nDescribe a controller filter you wrote. | I put a controller filter into the application controller so that the current user is always found before a controller action is performed. \r\nWhat was one thing that you gained more clarity on through this assignment? | I gained more clarity on ERD diagrams and feel like I'm able to better visualize what is happening when requests are made  in rails. \r\nWhat is the Heroku URL of your deployed application? | https://ktjmedia.herokuapp.com/\r\nDo you have any recommendations on how we could improve this project for the next cohort? | I thought it went well and wouldn't make many changes, I liked how we continued to work on the ada books as a class and those examples helped me figure out how to do things on my media ranker. \r\n","created_at":"2018-10-14T21:00:22Z","updated_at":"2018-10-23T17:53:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09518da7caca7a05f4c980778271e3e5cb2f1bb9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/14/commits","review_comments_url":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/14/comments","review_comment_url":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ada-C10/MediaRanker/issues/14/comments","statuses_url":"https://api.github.com/repos/Ada-C10/MediaRanker/statuses/cf95b980337fd96799c400a690ebb75719c02e27","head":{"label":"katietj:master","ref":"master","sha":"cf95b980337fd96799c400a690ebb75719c02e27","user":{"login":"katietj","id":25754627,"node_id":"MDQ6VXNlcjI1NzU0NjI3","avatar_url":"https://avatars0.githubusercontent.com/u/25754627?v=4","gravatar_id":"","url":"https://api.github.com/users/katietj","html_url":"https://github.com/katietj","followers_url":"https://api.github.com/users/katietj/followers","following_url":"https://api.github.com/users/katietj/following{/other_user}","gists_url":"https://api.github.com/users/katietj/gists{/gist_id}","starred_url":"https://api.github.com/users/katietj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katietj/subscriptions","organizations_url":"https://api.github.com/users/katietj/orgs","repos_url":"https://api.github.com/users/katietj/repos","events_url":"https://api.github.com/users/katietj/events{/privacy}","received_events_url":"https://api.github.com/users/katietj/received_events","type":"User","site_admin":false},"repo":{"id":152146503,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIxNDY1MDM=","name":"MediaRanker","full_name":"katietj/MediaRanker","private":false,"owner":{"login":"katietj","id":25754627,"node_id":"MDQ6VXNlcjI1NzU0NjI3","avatar_url":"https://avatars0.githubusercontent.com/u/25754627?v=4","gravatar_id":"","url":"https://api.github.com/users/katietj","html_url":"https://github.com/katietj","followers_url":"https://api.github.com/users/katietj/followers","following_url":"https://api.github.com/users/katietj/following{/other_user}","gists_url":"https://api.github.com/users/katietj/gists{/gist_id}","starred_url":"https://api.github.com/users/katietj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katietj/subscriptions","organizations_url":"https://api.github.com/users/katietj/orgs","repos_url":"https://api.github.com/users/katietj/repos","events_url":"https://api.github.com/users/katietj/events{/privacy}","received_events_url":"https://api.github.com/users/katietj/received_events","type":"User","site_admin":false},"html_url":"https://github.com/katietj/MediaRanker","description":null,"fork":true,"url":"https://api.github.com/repos/katietj/MediaRanker","forks_url":"https://api.github.com/repos/katietj/MediaRanker/forks","keys_url":"https://api.github.com/repos/katietj/MediaRanker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/katietj/MediaRanker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/katietj/MediaRanker/teams","hooks_url":"https://api.github.com/repos/katietj/MediaRanker/hooks","issue_events_url":"https://api.github.com/repos/katietj/MediaRanker/issues/events{/number}","events_url":"https://api.github.com/repos/katietj/MediaRanker/events","assignees_url":"https://api.github.com/repos/katietj/MediaRanker/assignees{/user}","branches_url":"https://api.github.com/repos/katietj/MediaRanker/branches{/branch}","tags_url":"https://api.github.com/repos/katietj/MediaRanker/tags","blobs_url":"https://api.github.com/repos/katietj/MediaRanker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/katietj/MediaRanker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/katietj/MediaRanker/git/refs{/sha}","trees_url":"https://api.github.com/repos/katietj/MediaRanker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/katietj/MediaRanker/statuses/{sha}","languages_url":"https://api.github.com/repos/katietj/MediaRanker/languages","stargazers_url":"https://api.github.com/repos/katietj/MediaRanker/stargazers","contributors_url":"https://api.github.com/repos/katietj/MediaRanker/contributors","subscribers_url":"https://api.github.com/repos/katietj/MediaRanker/subscribers","subscription_url":"https://api.github.com/repos/katietj/MediaRanker/subscription","commits_url":"https://api.github.com/repos/katietj/MediaRanker/commits{/sha}","git_commits_url":"https://api.github.com/repos/katietj/MediaRanker/git/commits{/sha}","comments_url":"https://api.github.com/repos/katietj/MediaRanker/comments{/number}","issue_comment_url":"https://api.github.com/repos/katietj/MediaRanker/issues/comments{/number}","contents_url":"https://api.github.com/repos/katietj/MediaRanker/contents/{+path}","compare_url":"https://api.github.com/repos/katietj/MediaRanker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/katietj/MediaRanker/merges","archive_url":"https://api.github.com/repos/katietj/MediaRanker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/katietj/MediaRanker/downloads","issues_url":"https://api.github.com/repos/katietj/MediaRanker/issues{/number}","pulls_url":"https://api.github.com/repos/katietj/MediaRanker/pulls{/number}","milestones_url":"https://api.github.com/repos/katietj/MediaRanker/milestones{/number}","notifications_url":"https://api.github.com/repos/katietj/MediaRanker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/katietj/MediaRanker/labels{/name}","releases_url":"https://api.github.com/repos/katietj/MediaRanker/releases{/id}","deployments_url":"https://api.github.com/repos/katietj/MediaRanker/deployments","created_at":"2018-10-08T21:03:55Z","updated_at":"2018-10-14T20:36:33Z","pushed_at":"2018-10-14T20:36:32Z","git_url":"git://github.com/katietj/MediaRanker.git","ssh_url":"git@github.com:katietj/MediaRanker.git","clone_url":"https://github.com/katietj/MediaRanker.git","svn_url":"https://github.com/katietj/MediaRanker","homepage":null,"size":106,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Ada-C10:master","ref":"master","sha":"8789cca6c19f09adbc0f536a5a4a302dd4bb5a25","user":{"login":"Ada-C10","id":40303054,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMzAzMDU0","avatar_url":"https://avatars0.githubusercontent.com/u/40303054?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C10","html_url":"https://github.com/Ada-C10","followers_url":"https://api.github.com/users/Ada-C10/followers","following_url":"https://api.github.com/users/Ada-C10/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C10/subscriptions","organizations_url":"https://api.github.com/users/Ada-C10/orgs","repos_url":"https://api.github.com/users/Ada-C10/repos","events_url":"https://api.github.com/users/Ada-C10/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C10/received_events","type":"Organization","site_admin":false},"repo":{"id":151781635,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE3ODE2MzU=","name":"MediaRanker","full_name":"Ada-C10/MediaRanker","private":false,"owner":{"login":"Ada-C10","id":40303054,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwMzAzMDU0","avatar_url":"https://avatars0.githubusercontent.com/u/40303054?v=4","gravatar_id":"","url":"https://api.github.com/users/Ada-C10","html_url":"https://github.com/Ada-C10","followers_url":"https://api.github.com/users/Ada-C10/followers","following_url":"https://api.github.com/users/Ada-C10/following{/other_user}","gists_url":"https://api.github.com/users/Ada-C10/gists{/gist_id}","starred_url":"https://api.github.com/users/Ada-C10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ada-C10/subscriptions","organizations_url":"https://api.github.com/users/Ada-C10/orgs","repos_url":"https://api.github.com/users/Ada-C10/repos","events_url":"https://api.github.com/users/Ada-C10/events{/privacy}","received_events_url":"https://api.github.com/users/Ada-C10/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Ada-C10/MediaRanker","description":null,"fork":true,"url":"https://api.github.com/repos/Ada-C10/MediaRanker","forks_url":"https://api.github.com/repos/Ada-C10/MediaRanker/forks","keys_url":"https://api.github.com/repos/Ada-C10/MediaRanker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ada-C10/MediaRanker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ada-C10/MediaRanker/teams","hooks_url":"https://api.github.com/repos/Ada-C10/MediaRanker/hooks","issue_events_url":"https://api.github.com/repos/Ada-C10/MediaRanker/issues/events{/number}","events_url":"https://api.github.com/repos/Ada-C10/MediaRanker/events","assignees_url":"https://api.github.com/repos/Ada-C10/MediaRanker/assignees{/user}","branches_url":"https://api.github.com/repos/Ada-C10/MediaRanker/branches{/branch}","tags_url":"https://api.github.com/repos/Ada-C10/MediaRanker/tags","blobs_url":"https://api.github.com/repos/Ada-C10/MediaRanker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ada-C10/MediaRanker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ada-C10/MediaRanker/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ada-C10/MediaRanker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ada-C10/MediaRanker/statuses/{sha}","languages_url":"https://api.github.com/repos/Ada-C10/MediaRanker/languages","stargazers_url":"https://api.github.com/repos/Ada-C10/MediaRanker/stargazers","contributors_url":"https://api.github.com/repos/Ada-C10/MediaRanker/contributors","subscribers_url":"https://api.github.com/repos/Ada-C10/MediaRanker/subscribers","subscription_url":"https://api.github.com/repos/Ada-C10/MediaRanker/subscription","commits_url":"https://api.github.com/repos/Ada-C10/MediaRanker/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ada-C10/MediaRanker/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ada-C10/MediaRanker/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ada-C10/MediaRanker/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ada-C10/MediaRanker/contents/{+path}","compare_url":"https://api.github.com/repos/Ada-C10/MediaRanker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ada-C10/MediaRanker/merges","archive_url":"https://api.github.com/repos/Ada-C10/MediaRanker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ada-C10/MediaRanker/downloads","issues_url":"https://api.github.com/repos/Ada-C10/MediaRanker/issues{/number}","pulls_url":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls{/number}","milestones_url":"https://api.github.com/repos/Ada-C10/MediaRanker/milestones{/number}","notifications_url":"https://api.github.com/repos/Ada-C10/MediaRanker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ada-C10/MediaRanker/labels{/name}","releases_url":"https://api.github.com/repos/Ada-C10/MediaRanker/releases{/id}","deployments_url":"https://api.github.com/repos/Ada-C10/MediaRanker/deployments","created_at":"2018-10-05T21:48:56Z","updated_at":"2018-10-05T21:53:16Z","pushed_at":"2018-10-19T04:12:32Z","git_url":"git://github.com/Ada-C10/MediaRanker.git","ssh_url":"git@github.com:Ada-C10/MediaRanker.git","clone_url":"https://github.com/Ada-C10/MediaRanker.git","svn_url":"https://github.com/Ada-C10/MediaRanker","homepage":null,"size":44,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"archived":false,"open_issues_count":47,"license":null,"forks":48,"open_issues":47,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/14"},"html":{"href":"https://github.com/Ada-C10/MediaRanker/pull/14"},"issue":{"href":"https://api.github.com/repos/Ada-C10/MediaRanker/issues/14"},"comments":{"href":"https://api.github.com/repos/Ada-C10/MediaRanker/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ada-C10/MediaRanker/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/Ada-C10/MediaRanker/statuses/cf95b980337fd96799c400a690ebb75719c02e27"}},"author_association":"NONE"}}
{"actor":{"display_login":"dHelmgren"}}