{"action":"created","comment":{"url":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/comments/29661175","id":29661175,"diff_hunk":"@@ -0,0 +1,67 @@\n+require \"rails_helper\"\n+\n+describe LoansController do\n+  before { sign_in_user(user) }\n+\n+  describe \"#create\" do\n+    it \"records an event for loan creation\" do\n+      allow_any_instance_of(Loan).to receive(:save).and_return(true)\n+      loan_event = double(\"LoanEvent\", record: nil)\n+      allow(LoanEvent).to receive(:new).and_return(loan_event)\n+\n+      post :create, user_id: user.id,\n+                    loan: { accrued_interest: \"200.00\",\n+                            disbursement_date: Date.today,\n+                            name: \"My Loan\",\n+                            principal: \"10000.00\" }\n+\n+      expect(loan_event).to have_received(:record)\n+    end\n+  end\n+\n+  describe \"#update\" do\n+    it \"sends an event\" do\n+      loan = create(\n+        :loan,\n+        user: user\n+      )\n+      loan_event = stub_loan_update_event\n+\n+      put :update, id: loan.id, user_id: user.id,\n+                                loan: { accrued_interest: \"13.57\" }","path":"spec/controllers/loans_controller_spec.rb","position":31,"original_position":31,"commit_id":"ddec75ca040b8b3e9471436578525e452be568c3","original_commit_id":"ddec75ca040b8b3e9471436578525e452be568c3","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Align the elements of a hash literal if they span more than one line.","created_at":"2015-05-05T11:40:13Z","updated_at":"2015-05-05T11:40:13Z","html_url":"https://github.com/lukad03/student-loan-calculator/pull/17#discussion_r29661175","pull_request_url":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/comments/29661175"},"html":{"href":"https://github.com/lukad03/student-loan-calculator/pull/17#discussion_r29661175"},"pull_request":{"href":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/17","id":34715741,"html_url":"https://github.com/lukad03/student-loan-calculator/pull/17","diff_url":"https://github.com/lukad03/student-loan-calculator/pull/17.diff","patch_url":"https://github.com/lukad03/student-loan-calculator/pull/17.patch","issue_url":"https://api.github.com/repos/lukad03/student-loan-calculator/issues/17","number":17,"state":"open","locked":false,"title":"Event Tracking","user":{"login":"lukad03","id":2506817,"avatar_url":"https://avatars.githubusercontent.com/u/2506817?v=3","gravatar_id":"","url":"https://api.github.com/users/lukad03","html_url":"https://github.com/lukad03","followers_url":"https://api.github.com/users/lukad03/followers","following_url":"https://api.github.com/users/lukad03/following{/other_user}","gists_url":"https://api.github.com/users/lukad03/gists{/gist_id}","starred_url":"https://api.github.com/users/lukad03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukad03/subscriptions","organizations_url":"https://api.github.com/users/lukad03/orgs","repos_url":"https://api.github.com/users/lukad03/repos","events_url":"https://api.github.com/users/lukad03/events{/privacy}","received_events_url":"https://api.github.com/users/lukad03/received_events","type":"User","site_admin":false},"body":"* Add `Analytics-ruby` gem for event tracking\r\n* Create base `Event` model from which other events are inheriting properties of\r\n* Add controller specs for each event\r\n\r\nEvent tracking has *not* been added to items inheriting `Forgiveness` since this requires a refactor. `update_all` is poor practice, so I'll be creating a `Forgiveness` model or something similarly named to handle this process and track events accordingly.","created_at":"2015-05-05T11:33:48Z","updated_at":"2015-05-05T11:40:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0f0ea44ee10079d9e7f7cfd7f25c56906b9bcdb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/17/commits","review_comments_url":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/17/comments","review_comment_url":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lukad03/student-loan-calculator/issues/17/comments","statuses_url":"https://api.github.com/repos/lukad03/student-loan-calculator/statuses/ddec75ca040b8b3e9471436578525e452be568c3","head":{"label":"lukad03:lk-event-tracking","ref":"lk-event-tracking","sha":"ddec75ca040b8b3e9471436578525e452be568c3","user":{"login":"lukad03","id":2506817,"avatar_url":"https://avatars.githubusercontent.com/u/2506817?v=3","gravatar_id":"","url":"https://api.github.com/users/lukad03","html_url":"https://github.com/lukad03","followers_url":"https://api.github.com/users/lukad03/followers","following_url":"https://api.github.com/users/lukad03/following{/other_user}","gists_url":"https://api.github.com/users/lukad03/gists{/gist_id}","starred_url":"https://api.github.com/users/lukad03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukad03/subscriptions","organizations_url":"https://api.github.com/users/lukad03/orgs","repos_url":"https://api.github.com/users/lukad03/repos","events_url":"https://api.github.com/users/lukad03/events{/privacy}","received_events_url":"https://api.github.com/users/lukad03/received_events","type":"User","site_admin":false},"repo":{"id":30134891,"name":"student-loan-calculator","full_name":"lukad03/student-loan-calculator","owner":{"login":"lukad03","id":2506817,"avatar_url":"https://avatars.githubusercontent.com/u/2506817?v=3","gravatar_id":"","url":"https://api.github.com/users/lukad03","html_url":"https://github.com/lukad03","followers_url":"https://api.github.com/users/lukad03/followers","following_url":"https://api.github.com/users/lukad03/following{/other_user}","gists_url":"https://api.github.com/users/lukad03/gists{/gist_id}","starred_url":"https://api.github.com/users/lukad03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukad03/subscriptions","organizations_url":"https://api.github.com/users/lukad03/orgs","repos_url":"https://api.github.com/users/lukad03/repos","events_url":"https://api.github.com/users/lukad03/events{/privacy}","received_events_url":"https://api.github.com/users/lukad03/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lukad03/student-loan-calculator","description":"A Ruby on Rails app for calculating different payment options and scenarios for repaying student loans.","fork":false,"url":"https://api.github.com/repos/lukad03/student-loan-calculator","forks_url":"https://api.github.com/repos/lukad03/student-loan-calculator/forks","keys_url":"https://api.github.com/repos/lukad03/student-loan-calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lukad03/student-loan-calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lukad03/student-loan-calculator/teams","hooks_url":"https://api.github.com/repos/lukad03/student-loan-calculator/hooks","issue_events_url":"https://api.github.com/repos/lukad03/student-loan-calculator/issues/events{/number}","events_url":"https://api.github.com/repos/lukad03/student-loan-calculator/events","assignees_url":"https://api.github.com/repos/lukad03/student-loan-calculator/assignees{/user}","branches_url":"https://api.github.com/repos/lukad03/student-loan-calculator/branches{/branch}","tags_url":"https://api.github.com/repos/lukad03/student-loan-calculator/tags","blobs_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lukad03/student-loan-calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/lukad03/student-loan-calculator/languages","stargazers_url":"https://api.github.com/repos/lukad03/student-loan-calculator/stargazers","contributors_url":"https://api.github.com/repos/lukad03/student-loan-calculator/contributors","subscribers_url":"https://api.github.com/repos/lukad03/student-loan-calculator/subscribers","subscription_url":"https://api.github.com/repos/lukad03/student-loan-calculator/subscription","commits_url":"https://api.github.com/repos/lukad03/student-loan-calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/lukad03/student-loan-calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/lukad03/student-loan-calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/lukad03/student-loan-calculator/contents/{+path}","compare_url":"https://api.github.com/repos/lukad03/student-loan-calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lukad03/student-loan-calculator/merges","archive_url":"https://api.github.com/repos/lukad03/student-loan-calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lukad03/student-loan-calculator/downloads","issues_url":"https://api.github.com/repos/lukad03/student-loan-calculator/issues{/number}","pulls_url":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/lukad03/student-loan-calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/lukad03/student-loan-calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lukad03/student-loan-calculator/labels{/name}","releases_url":"https://api.github.com/repos/lukad03/student-loan-calculator/releases{/id}","created_at":"2015-02-01T03:22:33Z","updated_at":"2015-05-03T20:57:45Z","pushed_at":"2015-05-05T11:40:08Z","git_url":"git://github.com/lukad03/student-loan-calculator.git","ssh_url":"git@github.com:lukad03/student-loan-calculator.git","clone_url":"https://github.com/lukad03/student-loan-calculator.git","svn_url":"https://github.com/lukad03/student-loan-calculator","homepage":null,"size":4340,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lukad03:master","ref":"master","sha":"1c08b673996e5f900aa00109549a58d13db64345","user":{"login":"lukad03","id":2506817,"avatar_url":"https://avatars.githubusercontent.com/u/2506817?v=3","gravatar_id":"","url":"https://api.github.com/users/lukad03","html_url":"https://github.com/lukad03","followers_url":"https://api.github.com/users/lukad03/followers","following_url":"https://api.github.com/users/lukad03/following{/other_user}","gists_url":"https://api.github.com/users/lukad03/gists{/gist_id}","starred_url":"https://api.github.com/users/lukad03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukad03/subscriptions","organizations_url":"https://api.github.com/users/lukad03/orgs","repos_url":"https://api.github.com/users/lukad03/repos","events_url":"https://api.github.com/users/lukad03/events{/privacy}","received_events_url":"https://api.github.com/users/lukad03/received_events","type":"User","site_admin":false},"repo":{"id":30134891,"name":"student-loan-calculator","full_name":"lukad03/student-loan-calculator","owner":{"login":"lukad03","id":2506817,"avatar_url":"https://avatars.githubusercontent.com/u/2506817?v=3","gravatar_id":"","url":"https://api.github.com/users/lukad03","html_url":"https://github.com/lukad03","followers_url":"https://api.github.com/users/lukad03/followers","following_url":"https://api.github.com/users/lukad03/following{/other_user}","gists_url":"https://api.github.com/users/lukad03/gists{/gist_id}","starred_url":"https://api.github.com/users/lukad03/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukad03/subscriptions","organizations_url":"https://api.github.com/users/lukad03/orgs","repos_url":"https://api.github.com/users/lukad03/repos","events_url":"https://api.github.com/users/lukad03/events{/privacy}","received_events_url":"https://api.github.com/users/lukad03/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lukad03/student-loan-calculator","description":"A Ruby on Rails app for calculating different payment options and scenarios for repaying student loans.","fork":false,"url":"https://api.github.com/repos/lukad03/student-loan-calculator","forks_url":"https://api.github.com/repos/lukad03/student-loan-calculator/forks","keys_url":"https://api.github.com/repos/lukad03/student-loan-calculator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lukad03/student-loan-calculator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lukad03/student-loan-calculator/teams","hooks_url":"https://api.github.com/repos/lukad03/student-loan-calculator/hooks","issue_events_url":"https://api.github.com/repos/lukad03/student-loan-calculator/issues/events{/number}","events_url":"https://api.github.com/repos/lukad03/student-loan-calculator/events","assignees_url":"https://api.github.com/repos/lukad03/student-loan-calculator/assignees{/user}","branches_url":"https://api.github.com/repos/lukad03/student-loan-calculator/branches{/branch}","tags_url":"https://api.github.com/repos/lukad03/student-loan-calculator/tags","blobs_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/refs{/sha}","trees_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lukad03/student-loan-calculator/statuses/{sha}","languages_url":"https://api.github.com/repos/lukad03/student-loan-calculator/languages","stargazers_url":"https://api.github.com/repos/lukad03/student-loan-calculator/stargazers","contributors_url":"https://api.github.com/repos/lukad03/student-loan-calculator/contributors","subscribers_url":"https://api.github.com/repos/lukad03/student-loan-calculator/subscribers","subscription_url":"https://api.github.com/repos/lukad03/student-loan-calculator/subscription","commits_url":"https://api.github.com/repos/lukad03/student-loan-calculator/commits{/sha}","git_commits_url":"https://api.github.com/repos/lukad03/student-loan-calculator/git/commits{/sha}","comments_url":"https://api.github.com/repos/lukad03/student-loan-calculator/comments{/number}","issue_comment_url":"https://api.github.com/repos/lukad03/student-loan-calculator/issues/comments{/number}","contents_url":"https://api.github.com/repos/lukad03/student-loan-calculator/contents/{+path}","compare_url":"https://api.github.com/repos/lukad03/student-loan-calculator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lukad03/student-loan-calculator/merges","archive_url":"https://api.github.com/repos/lukad03/student-loan-calculator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lukad03/student-loan-calculator/downloads","issues_url":"https://api.github.com/repos/lukad03/student-loan-calculator/issues{/number}","pulls_url":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls{/number}","milestones_url":"https://api.github.com/repos/lukad03/student-loan-calculator/milestones{/number}","notifications_url":"https://api.github.com/repos/lukad03/student-loan-calculator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lukad03/student-loan-calculator/labels{/name}","releases_url":"https://api.github.com/repos/lukad03/student-loan-calculator/releases{/id}","created_at":"2015-02-01T03:22:33Z","updated_at":"2015-05-03T20:57:45Z","pushed_at":"2015-05-05T11:40:08Z","git_url":"git://github.com/lukad03/student-loan-calculator.git","ssh_url":"git@github.com:lukad03/student-loan-calculator.git","clone_url":"https://github.com/lukad03/student-loan-calculator.git","svn_url":"https://github.com/lukad03/student-loan-calculator","homepage":null,"size":4340,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/17"},"html":{"href":"https://github.com/lukad03/student-loan-calculator/pull/17"},"issue":{"href":"https://api.github.com/repos/lukad03/student-loan-calculator/issues/17"},"comments":{"href":"https://api.github.com/repos/lukad03/student-loan-calculator/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lukad03/student-loan-calculator/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/lukad03/student-loan-calculator/statuses/ddec75ca040b8b3e9471436578525e452be568c3"}}}}