{"action":"created","comment":{"url":"https://api.github.com/repos/hbellows/black_thursday/pulls/comments/205583893","pull_request_review_id":140886248,"id":205583893,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTU4Mzg5Mw==","diff_hunk":"@@ -0,0 +1,93 @@\n+require './test/test_helper'\n+require './lib/customer_repository'\n+require './lib/file_loader'\n+\n+class CustomerRespositoryTest < Minitest::Test\n+\n+  def setup\n+    @mock_data = [\n+      {:id => 1,\n+      :first_name => \"Joan\",\n+      :last_name => \"Clarke\",\n+      :created_at => Time.now,\n+      :updated_at => Time.now},\n+      {:id => 2,\n+      :first_name => \"Jimmy\",\n+      :last_name => \"John\",\n+      :created_at => Time.now,\n+      :updated_at => Time.now},\n+      {:id => 3,\n+      :first_name => \"Jessica\",\n+      :last_name => \"Jones\",\n+      :created_at => Time.now,\n+      :updated_at => Time.now},\n+      {:id => 4,\n+      :first_name => \"James Earl\",\n+      :last_name => \"Jones\",\n+      :created_at => Time.now,\n+      :updated_at => Time.now}\n+      ]\n+\n+    @customer_repo = CustomerRespository.new(@mock_data)\n+  end\n+\n+  def test_it_exists\n+    assert_instance_of CustomerRespository, @customer_repo\n+  end\n+\n+  def test_it_can_find_all_customers\n+    assert_equal 4, @customer_repo.all.count\n+  end\n+\n+  def test_it_can_find_a_customer_by_id\n+    assert_equal @customer_repo.all[-1], @customer_repo.find_by_id(4)\n+    assert_equal @customer_repo.all[0], @customer_repo.find_by_id(1)\n+  end\n+\n+  def test_it_can_find_customers_by_first_name\n+    expected = [@customer_repo.all[-1]]\n+    actual = @customer_repo.find_all_by_first_name(\"James Earl\")\n+    assert_equal expected, actual\n+  end\n+\n+  def test_it_can_find_customers_by_last_name\n+    expected = [@customer_repo.all[2], @customer_repo.all[3]]\n+    actual = @customer_repo.find_all_by_last_name(\"Jones\")\n+    assert_equal expected, actual\n+  end\n+\n+  def test_it_can_create_a_new_customer\n+    @customer_repo.create({\n+      :first_name => \"Jane\",\n+      :last_name => \"Smith\",\n+      :created_at => Time.now,\n+      :updated_at => Time.now\n+      })\n+\n+    assert_equal 5, @customer_repo.all[-1].id\n+    assert_equal \"Jane\", @customer_repo.all[-1].first_name","path":"test/customer_repository_test.rb","position":68,"original_position":68,"commit_id":"442ec08db37c1567561c52766dda9b0be1d0c6fc","original_commit_id":"442ec08db37c1567561c52766dda9b0be1d0c6fc","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.","created_at":"2018-07-26T19:59:12Z","updated_at":"2018-07-26T19:59:14Z","html_url":"https://github.com/hbellows/black_thursday/pull/49#discussion_r205583893","pull_request_url":"https://api.github.com/repos/hbellows/black_thursday/pulls/49","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/hbellows/black_thursday/pulls/comments/205583893"},"html":{"href":"https://github.com/hbellows/black_thursday/pull/49#discussion_r205583893"},"pull_request":{"href":"https://api.github.com/repos/hbellows/black_thursday/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/hbellows/black_thursday/pulls/49","id":204250479,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MjUwNDc5","html_url":"https://github.com/hbellows/black_thursday/pull/49","diff_url":"https://github.com/hbellows/black_thursday/pull/49.diff","patch_url":"https://github.com/hbellows/black_thursday/pull/49.patch","issue_url":"https://api.github.com/repos/hbellows/black_thursday/issues/49","number":49,"state":"open","locked":false,"title":"Customer repo","user":{"login":"hbellows","id":35637783,"node_id":"MDQ6VXNlcjM1NjM3Nzgz","avatar_url":"https://avatars2.githubusercontent.com/u/35637783?v=4","gravatar_id":"","url":"https://api.github.com/users/hbellows","html_url":"https://github.com/hbellows","followers_url":"https://api.github.com/users/hbellows/followers","following_url":"https://api.github.com/users/hbellows/following{/other_user}","gists_url":"https://api.github.com/users/hbellows/gists{/gist_id}","starred_url":"https://api.github.com/users/hbellows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbellows/subscriptions","organizations_url":"https://api.github.com/users/hbellows/orgs","repos_url":"https://api.github.com/users/hbellows/repos","events_url":"https://api.github.com/users/hbellows/events{/privacy}","received_events_url":"https://api.github.com/users/hbellows/received_events","type":"User","site_admin":false},"body":"Add final version of customer repo and unit test suite","created_at":"2018-07-26T19:59:02Z","updated_at":"2018-07-26T19:59:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"416e2d7b61239b33f19204cb86968be6d5e8c0d3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hbellows/black_thursday/pulls/49/commits","review_comments_url":"https://api.github.com/repos/hbellows/black_thursday/pulls/49/comments","review_comment_url":"https://api.github.com/repos/hbellows/black_thursday/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hbellows/black_thursday/issues/49/comments","statuses_url":"https://api.github.com/repos/hbellows/black_thursday/statuses/442ec08db37c1567561c52766dda9b0be1d0c6fc","head":{"label":"hbellows:Customer_Repo","ref":"Customer_Repo","sha":"442ec08db37c1567561c52766dda9b0be1d0c6fc","user":{"login":"hbellows","id":35637783,"node_id":"MDQ6VXNlcjM1NjM3Nzgz","avatar_url":"https://avatars2.githubusercontent.com/u/35637783?v=4","gravatar_id":"","url":"https://api.github.com/users/hbellows","html_url":"https://github.com/hbellows","followers_url":"https://api.github.com/users/hbellows/followers","following_url":"https://api.github.com/users/hbellows/following{/other_user}","gists_url":"https://api.github.com/users/hbellows/gists{/gist_id}","starred_url":"https://api.github.com/users/hbellows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbellows/subscriptions","organizations_url":"https://api.github.com/users/hbellows/orgs","repos_url":"https://api.github.com/users/hbellows/repos","events_url":"https://api.github.com/users/hbellows/events{/privacy}","received_events_url":"https://api.github.com/users/hbellows/received_events","type":"User","site_admin":false},"repo":{"id":141752686,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE3NTI2ODY=","name":"black_thursday","full_name":"hbellows/black_thursday","owner":{"login":"hbellows","id":35637783,"node_id":"MDQ6VXNlcjM1NjM3Nzgz","avatar_url":"https://avatars2.githubusercontent.com/u/35637783?v=4","gravatar_id":"","url":"https://api.github.com/users/hbellows","html_url":"https://github.com/hbellows","followers_url":"https://api.github.com/users/hbellows/followers","following_url":"https://api.github.com/users/hbellows/following{/other_user}","gists_url":"https://api.github.com/users/hbellows/gists{/gist_id}","starred_url":"https://api.github.com/users/hbellows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbellows/subscriptions","organizations_url":"https://api.github.com/users/hbellows/orgs","repos_url":"https://api.github.com/users/hbellows/repos","events_url":"https://api.github.com/users/hbellows/events{/privacy}","received_events_url":"https://api.github.com/users/hbellows/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hbellows/black_thursday","description":null,"fork":true,"url":"https://api.github.com/repos/hbellows/black_thursday","forks_url":"https://api.github.com/repos/hbellows/black_thursday/forks","keys_url":"https://api.github.com/repos/hbellows/black_thursday/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hbellows/black_thursday/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hbellows/black_thursday/teams","hooks_url":"https://api.github.com/repos/hbellows/black_thursday/hooks","issue_events_url":"https://api.github.com/repos/hbellows/black_thursday/issues/events{/number}","events_url":"https://api.github.com/repos/hbellows/black_thursday/events","assignees_url":"https://api.github.com/repos/hbellows/black_thursday/assignees{/user}","branches_url":"https://api.github.com/repos/hbellows/black_thursday/branches{/branch}","tags_url":"https://api.github.com/repos/hbellows/black_thursday/tags","blobs_url":"https://api.github.com/repos/hbellows/black_thursday/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hbellows/black_thursday/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hbellows/black_thursday/git/refs{/sha}","trees_url":"https://api.github.com/repos/hbellows/black_thursday/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hbellows/black_thursday/statuses/{sha}","languages_url":"https://api.github.com/repos/hbellows/black_thursday/languages","stargazers_url":"https://api.github.com/repos/hbellows/black_thursday/stargazers","contributors_url":"https://api.github.com/repos/hbellows/black_thursday/contributors","subscribers_url":"https://api.github.com/repos/hbellows/black_thursday/subscribers","subscription_url":"https://api.github.com/repos/hbellows/black_thursday/subscription","commits_url":"https://api.github.com/repos/hbellows/black_thursday/commits{/sha}","git_commits_url":"https://api.github.com/repos/hbellows/black_thursday/git/commits{/sha}","comments_url":"https://api.github.com/repos/hbellows/black_thursday/comments{/number}","issue_comment_url":"https://api.github.com/repos/hbellows/black_thursday/issues/comments{/number}","contents_url":"https://api.github.com/repos/hbellows/black_thursday/contents/{+path}","compare_url":"https://api.github.com/repos/hbellows/black_thursday/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hbellows/black_thursday/merges","archive_url":"https://api.github.com/repos/hbellows/black_thursday/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hbellows/black_thursday/downloads","issues_url":"https://api.github.com/repos/hbellows/black_thursday/issues{/number}","pulls_url":"https://api.github.com/repos/hbellows/black_thursday/pulls{/number}","milestones_url":"https://api.github.com/repos/hbellows/black_thursday/milestones{/number}","notifications_url":"https://api.github.com/repos/hbellows/black_thursday/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hbellows/black_thursday/labels{/name}","releases_url":"https://api.github.com/repos/hbellows/black_thursday/releases{/id}","deployments_url":"https://api.github.com/repos/hbellows/black_thursday/deployments","created_at":"2018-07-20T19:59:40Z","updated_at":"2018-07-26T18:21:27Z","pushed_at":"2018-07-26T19:59:03Z","git_url":"git://github.com/hbellows/black_thursday.git","ssh_url":"git@github.com:hbellows/black_thursday.git","clone_url":"https://github.com/hbellows/black_thursday.git","svn_url":"https://github.com/hbellows/black_thursday","homepage":null,"size":1769,"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":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"hbellows:master","ref":"master","sha":"e8a4e4d79c0a77def7c882d658558af5c0e8c067","user":{"login":"hbellows","id":35637783,"node_id":"MDQ6VXNlcjM1NjM3Nzgz","avatar_url":"https://avatars2.githubusercontent.com/u/35637783?v=4","gravatar_id":"","url":"https://api.github.com/users/hbellows","html_url":"https://github.com/hbellows","followers_url":"https://api.github.com/users/hbellows/followers","following_url":"https://api.github.com/users/hbellows/following{/other_user}","gists_url":"https://api.github.com/users/hbellows/gists{/gist_id}","starred_url":"https://api.github.com/users/hbellows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbellows/subscriptions","organizations_url":"https://api.github.com/users/hbellows/orgs","repos_url":"https://api.github.com/users/hbellows/repos","events_url":"https://api.github.com/users/hbellows/events{/privacy}","received_events_url":"https://api.github.com/users/hbellows/received_events","type":"User","site_admin":false},"repo":{"id":141752686,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE3NTI2ODY=","name":"black_thursday","full_name":"hbellows/black_thursday","owner":{"login":"hbellows","id":35637783,"node_id":"MDQ6VXNlcjM1NjM3Nzgz","avatar_url":"https://avatars2.githubusercontent.com/u/35637783?v=4","gravatar_id":"","url":"https://api.github.com/users/hbellows","html_url":"https://github.com/hbellows","followers_url":"https://api.github.com/users/hbellows/followers","following_url":"https://api.github.com/users/hbellows/following{/other_user}","gists_url":"https://api.github.com/users/hbellows/gists{/gist_id}","starred_url":"https://api.github.com/users/hbellows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hbellows/subscriptions","organizations_url":"https://api.github.com/users/hbellows/orgs","repos_url":"https://api.github.com/users/hbellows/repos","events_url":"https://api.github.com/users/hbellows/events{/privacy}","received_events_url":"https://api.github.com/users/hbellows/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hbellows/black_thursday","description":null,"fork":true,"url":"https://api.github.com/repos/hbellows/black_thursday","forks_url":"https://api.github.com/repos/hbellows/black_thursday/forks","keys_url":"https://api.github.com/repos/hbellows/black_thursday/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hbellows/black_thursday/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hbellows/black_thursday/teams","hooks_url":"https://api.github.com/repos/hbellows/black_thursday/hooks","issue_events_url":"https://api.github.com/repos/hbellows/black_thursday/issues/events{/number}","events_url":"https://api.github.com/repos/hbellows/black_thursday/events","assignees_url":"https://api.github.com/repos/hbellows/black_thursday/assignees{/user}","branches_url":"https://api.github.com/repos/hbellows/black_thursday/branches{/branch}","tags_url":"https://api.github.com/repos/hbellows/black_thursday/tags","blobs_url":"https://api.github.com/repos/hbellows/black_thursday/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hbellows/black_thursday/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hbellows/black_thursday/git/refs{/sha}","trees_url":"https://api.github.com/repos/hbellows/black_thursday/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hbellows/black_thursday/statuses/{sha}","languages_url":"https://api.github.com/repos/hbellows/black_thursday/languages","stargazers_url":"https://api.github.com/repos/hbellows/black_thursday/stargazers","contributors_url":"https://api.github.com/repos/hbellows/black_thursday/contributors","subscribers_url":"https://api.github.com/repos/hbellows/black_thursday/subscribers","subscription_url":"https://api.github.com/repos/hbellows/black_thursday/subscription","commits_url":"https://api.github.com/repos/hbellows/black_thursday/commits{/sha}","git_commits_url":"https://api.github.com/repos/hbellows/black_thursday/git/commits{/sha}","comments_url":"https://api.github.com/repos/hbellows/black_thursday/comments{/number}","issue_comment_url":"https://api.github.com/repos/hbellows/black_thursday/issues/comments{/number}","contents_url":"https://api.github.com/repos/hbellows/black_thursday/contents/{+path}","compare_url":"https://api.github.com/repos/hbellows/black_thursday/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hbellows/black_thursday/merges","archive_url":"https://api.github.com/repos/hbellows/black_thursday/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hbellows/black_thursday/downloads","issues_url":"https://api.github.com/repos/hbellows/black_thursday/issues{/number}","pulls_url":"https://api.github.com/repos/hbellows/black_thursday/pulls{/number}","milestones_url":"https://api.github.com/repos/hbellows/black_thursday/milestones{/number}","notifications_url":"https://api.github.com/repos/hbellows/black_thursday/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hbellows/black_thursday/labels{/name}","releases_url":"https://api.github.com/repos/hbellows/black_thursday/releases{/id}","deployments_url":"https://api.github.com/repos/hbellows/black_thursday/deployments","created_at":"2018-07-20T19:59:40Z","updated_at":"2018-07-26T18:21:27Z","pushed_at":"2018-07-26T19:59:03Z","git_url":"git://github.com/hbellows/black_thursday.git","ssh_url":"git@github.com:hbellows/black_thursday.git","clone_url":"https://github.com/hbellows/black_thursday.git","svn_url":"https://github.com/hbellows/black_thursday","homepage":null,"size":1769,"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":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hbellows/black_thursday/pulls/49"},"html":{"href":"https://github.com/hbellows/black_thursday/pull/49"},"issue":{"href":"https://api.github.com/repos/hbellows/black_thursday/issues/49"},"comments":{"href":"https://api.github.com/repos/hbellows/black_thursday/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/hbellows/black_thursday/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/hbellows/black_thursday/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hbellows/black_thursday/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/hbellows/black_thursday/statuses/442ec08db37c1567561c52766dda9b0be1d0c6fc"}},"author_association":"OWNER"}}
{"actor":{"display_login":"houndci-bot"}}