{"action":"created","comment":{"url":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/comments/26059291","id":26059291,"diff_hunk":"@@ -16,16 +16,86 @@\n     expect(card.review(\"Incorrect value\")).to be false\n   end\n \n-  it \"moves the review date if answer is correct 3 days from today if review date is today\" do\n-    card.review_date = Date.today\n-    card.review(\"Correct value\")\n-    expect(card.review_date).to eql Date.today + 3.day\n-  end\n+  describe \"review process\" do\n+    it \"increment attempt counter if answer is correct\" do\n+      card.attempt_count = 0\n+      card.review(\"Correct value\")\n+      expect(card.attempt_count).to eql 1\n+    end\n+\n+    it \"moves the review date if answer is correct for dates in past\" do\n+      card.review_date = Date.yesterday\n+      card.review(\"Correct value\")\n+      expect(card.review_date).not_to eql Date.yesterday\n+    end\n+\n+    it \"nullify fail attempts counter if answer is correct\" do\n+      card.failed_attempt_count = 2\n+      card.review(\"Correct value\")\n+      expect(card.failed_attempt_count).to eql 0\n+    end\n+\n+    it \"increment fail attempts counter if answer is incorrect\" do\n+      card.failed_attempt_count = 0\n+      card.review(\"Incorrect\")\n+      expect(card.failed_attempt_count).to eql 1\n+    end\n+\n+    it \"nullify fail attempts counter after 3 incorrect answers\" do\n+      card.failed_attempt_count = 2\n+      card.review(\"Incorrect\")\n+      expect(card.failed_attempt_count).to eql 0\n+    end\n+\n+    it \"nullify attempts counter after 3 incorrect answers\" do\n+      card.failed_attempt_count = 2\n+      card.attempt_count = 3\n+      card.review(\"Incorrect\")\n+      expect(card.attempt_count).to eql 0\n+    end\n+\n+    it \"set review date 12 hours from now for 3 incorrect answers in row\" do\n+      card.failed_attempt_count = 2\n+      card.attempt_count = 3\n+      card.review(\"Incorrect\")\n+      expect(card.review_date).to be_within(20.seconds).of(Time.now + 12.hours)\n+    end\n+\n+    describe \"moves review_date for correct answer for\" do\n+      it \"12 hours from now if this is first review\" do\n+        card.review_date = Date.today\n+        card.attempt_count = 0\n+        card.review(\"Correct value\")\n+        expect(card.review_date).to be_within(20.seconds).of(Time.now + 12.hours)","path":"spec/models/card_spec.rb","position":59,"original_position":59,"commit_id":"71041e69fbcc71e2c60dfc39b1cfd70fa88e5b85","original_commit_id":"71041e69fbcc71e2c60dfc39b1cfd70fa88e5b85","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":"Line is too long. [81/80]","created_at":"2015-03-09T18:02:22Z","updated_at":"2015-03-09T18:02:22Z","html_url":"https://github.com/bvanyushin/cardsharper/pull/11#discussion_r26059291","pull_request_url":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/comments/26059291"},"html":{"href":"https://github.com/bvanyushin/cardsharper/pull/11#discussion_r26059291"},"pull_request":{"href":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/11","id":30784551,"html_url":"https://github.com/bvanyushin/cardsharper/pull/11","diff_url":"https://github.com/bvanyushin/cardsharper/pull/11.diff","patch_url":"https://github.com/bvanyushin/cardsharper/pull/11.patch","issue_url":"https://api.github.com/repos/bvanyushin/cardsharper/issues/11","number":11,"state":"open","locked":false,"title":"Twelth task","user":{"login":"bvanyushin","id":10248822,"avatar_url":"https://avatars.githubusercontent.com/u/10248822?v=3","gravatar_id":"","url":"https://api.github.com/users/bvanyushin","html_url":"https://github.com/bvanyushin","followers_url":"https://api.github.com/users/bvanyushin/followers","following_url":"https://api.github.com/users/bvanyushin/following{/other_user}","gists_url":"https://api.github.com/users/bvanyushin/gists{/gist_id}","starred_url":"https://api.github.com/users/bvanyushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvanyushin/subscriptions","organizations_url":"https://api.github.com/users/bvanyushin/orgs","repos_url":"https://api.github.com/users/bvanyushin/repos","events_url":"https://api.github.com/users/bvanyushin/events{/privacy}","received_events_url":"https://api.github.com/users/bvanyushin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-09T18:02:15Z","updated_at":"2015-03-09T18:02:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3bedf1d0c0b8edac849eab87ff9f9f2ff386e587","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/11/commits","review_comments_url":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/11/comments","review_comment_url":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bvanyushin/cardsharper/issues/11/comments","statuses_url":"https://api.github.com/repos/bvanyushin/cardsharper/statuses/71041e69fbcc71e2c60dfc39b1cfd70fa88e5b85","head":{"label":"bvanyushin:twelth-task","ref":"twelth-task","sha":"71041e69fbcc71e2c60dfc39b1cfd70fa88e5b85","user":{"login":"bvanyushin","id":10248822,"avatar_url":"https://avatars.githubusercontent.com/u/10248822?v=3","gravatar_id":"","url":"https://api.github.com/users/bvanyushin","html_url":"https://github.com/bvanyushin","followers_url":"https://api.github.com/users/bvanyushin/followers","following_url":"https://api.github.com/users/bvanyushin/following{/other_user}","gists_url":"https://api.github.com/users/bvanyushin/gists{/gist_id}","starred_url":"https://api.github.com/users/bvanyushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvanyushin/subscriptions","organizations_url":"https://api.github.com/users/bvanyushin/orgs","repos_url":"https://api.github.com/users/bvanyushin/repos","events_url":"https://api.github.com/users/bvanyushin/events{/privacy}","received_events_url":"https://api.github.com/users/bvanyushin/received_events","type":"User","site_admin":false},"repo":{"id":29139550,"name":"cardsharper","full_name":"bvanyushin/cardsharper","owner":{"login":"bvanyushin","id":10248822,"avatar_url":"https://avatars.githubusercontent.com/u/10248822?v=3","gravatar_id":"","url":"https://api.github.com/users/bvanyushin","html_url":"https://github.com/bvanyushin","followers_url":"https://api.github.com/users/bvanyushin/followers","following_url":"https://api.github.com/users/bvanyushin/following{/other_user}","gists_url":"https://api.github.com/users/bvanyushin/gists{/gist_id}","starred_url":"https://api.github.com/users/bvanyushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvanyushin/subscriptions","organizations_url":"https://api.github.com/users/bvanyushin/orgs","repos_url":"https://api.github.com/users/bvanyushin/repos","events_url":"https://api.github.com/users/bvanyushin/events{/privacy}","received_events_url":"https://api.github.com/users/bvanyushin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bvanyushin/cardsharper","description":"","fork":false,"url":"https://api.github.com/repos/bvanyushin/cardsharper","forks_url":"https://api.github.com/repos/bvanyushin/cardsharper/forks","keys_url":"https://api.github.com/repos/bvanyushin/cardsharper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bvanyushin/cardsharper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bvanyushin/cardsharper/teams","hooks_url":"https://api.github.com/repos/bvanyushin/cardsharper/hooks","issue_events_url":"https://api.github.com/repos/bvanyushin/cardsharper/issues/events{/number}","events_url":"https://api.github.com/repos/bvanyushin/cardsharper/events","assignees_url":"https://api.github.com/repos/bvanyushin/cardsharper/assignees{/user}","branches_url":"https://api.github.com/repos/bvanyushin/cardsharper/branches{/branch}","tags_url":"https://api.github.com/repos/bvanyushin/cardsharper/tags","blobs_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/refs{/sha}","trees_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bvanyushin/cardsharper/statuses/{sha}","languages_url":"https://api.github.com/repos/bvanyushin/cardsharper/languages","stargazers_url":"https://api.github.com/repos/bvanyushin/cardsharper/stargazers","contributors_url":"https://api.github.com/repos/bvanyushin/cardsharper/contributors","subscribers_url":"https://api.github.com/repos/bvanyushin/cardsharper/subscribers","subscription_url":"https://api.github.com/repos/bvanyushin/cardsharper/subscription","commits_url":"https://api.github.com/repos/bvanyushin/cardsharper/commits{/sha}","git_commits_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/commits{/sha}","comments_url":"https://api.github.com/repos/bvanyushin/cardsharper/comments{/number}","issue_comment_url":"https://api.github.com/repos/bvanyushin/cardsharper/issues/comments{/number}","contents_url":"https://api.github.com/repos/bvanyushin/cardsharper/contents/{+path}","compare_url":"https://api.github.com/repos/bvanyushin/cardsharper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bvanyushin/cardsharper/merges","archive_url":"https://api.github.com/repos/bvanyushin/cardsharper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bvanyushin/cardsharper/downloads","issues_url":"https://api.github.com/repos/bvanyushin/cardsharper/issues{/number}","pulls_url":"https://api.github.com/repos/bvanyushin/cardsharper/pulls{/number}","milestones_url":"https://api.github.com/repos/bvanyushin/cardsharper/milestones{/number}","notifications_url":"https://api.github.com/repos/bvanyushin/cardsharper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bvanyushin/cardsharper/labels{/name}","releases_url":"https://api.github.com/repos/bvanyushin/cardsharper/releases{/id}","created_at":"2015-01-12T14:37:00Z","updated_at":"2015-03-09T00:28:23Z","pushed_at":"2015-03-09T18:00:54Z","git_url":"git://github.com/bvanyushin/cardsharper.git","ssh_url":"git@github.com:bvanyushin/cardsharper.git","clone_url":"https://github.com/bvanyushin/cardsharper.git","svn_url":"https://github.com/bvanyushin/cardsharper","homepage":null,"size":632,"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":"bvanyushin:master","ref":"master","sha":"45dba7103df5684eca625d1032489798b6c9b20a","user":{"login":"bvanyushin","id":10248822,"avatar_url":"https://avatars.githubusercontent.com/u/10248822?v=3","gravatar_id":"","url":"https://api.github.com/users/bvanyushin","html_url":"https://github.com/bvanyushin","followers_url":"https://api.github.com/users/bvanyushin/followers","following_url":"https://api.github.com/users/bvanyushin/following{/other_user}","gists_url":"https://api.github.com/users/bvanyushin/gists{/gist_id}","starred_url":"https://api.github.com/users/bvanyushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvanyushin/subscriptions","organizations_url":"https://api.github.com/users/bvanyushin/orgs","repos_url":"https://api.github.com/users/bvanyushin/repos","events_url":"https://api.github.com/users/bvanyushin/events{/privacy}","received_events_url":"https://api.github.com/users/bvanyushin/received_events","type":"User","site_admin":false},"repo":{"id":29139550,"name":"cardsharper","full_name":"bvanyushin/cardsharper","owner":{"login":"bvanyushin","id":10248822,"avatar_url":"https://avatars.githubusercontent.com/u/10248822?v=3","gravatar_id":"","url":"https://api.github.com/users/bvanyushin","html_url":"https://github.com/bvanyushin","followers_url":"https://api.github.com/users/bvanyushin/followers","following_url":"https://api.github.com/users/bvanyushin/following{/other_user}","gists_url":"https://api.github.com/users/bvanyushin/gists{/gist_id}","starred_url":"https://api.github.com/users/bvanyushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvanyushin/subscriptions","organizations_url":"https://api.github.com/users/bvanyushin/orgs","repos_url":"https://api.github.com/users/bvanyushin/repos","events_url":"https://api.github.com/users/bvanyushin/events{/privacy}","received_events_url":"https://api.github.com/users/bvanyushin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bvanyushin/cardsharper","description":"","fork":false,"url":"https://api.github.com/repos/bvanyushin/cardsharper","forks_url":"https://api.github.com/repos/bvanyushin/cardsharper/forks","keys_url":"https://api.github.com/repos/bvanyushin/cardsharper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bvanyushin/cardsharper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bvanyushin/cardsharper/teams","hooks_url":"https://api.github.com/repos/bvanyushin/cardsharper/hooks","issue_events_url":"https://api.github.com/repos/bvanyushin/cardsharper/issues/events{/number}","events_url":"https://api.github.com/repos/bvanyushin/cardsharper/events","assignees_url":"https://api.github.com/repos/bvanyushin/cardsharper/assignees{/user}","branches_url":"https://api.github.com/repos/bvanyushin/cardsharper/branches{/branch}","tags_url":"https://api.github.com/repos/bvanyushin/cardsharper/tags","blobs_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/refs{/sha}","trees_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bvanyushin/cardsharper/statuses/{sha}","languages_url":"https://api.github.com/repos/bvanyushin/cardsharper/languages","stargazers_url":"https://api.github.com/repos/bvanyushin/cardsharper/stargazers","contributors_url":"https://api.github.com/repos/bvanyushin/cardsharper/contributors","subscribers_url":"https://api.github.com/repos/bvanyushin/cardsharper/subscribers","subscription_url":"https://api.github.com/repos/bvanyushin/cardsharper/subscription","commits_url":"https://api.github.com/repos/bvanyushin/cardsharper/commits{/sha}","git_commits_url":"https://api.github.com/repos/bvanyushin/cardsharper/git/commits{/sha}","comments_url":"https://api.github.com/repos/bvanyushin/cardsharper/comments{/number}","issue_comment_url":"https://api.github.com/repos/bvanyushin/cardsharper/issues/comments{/number}","contents_url":"https://api.github.com/repos/bvanyushin/cardsharper/contents/{+path}","compare_url":"https://api.github.com/repos/bvanyushin/cardsharper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bvanyushin/cardsharper/merges","archive_url":"https://api.github.com/repos/bvanyushin/cardsharper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bvanyushin/cardsharper/downloads","issues_url":"https://api.github.com/repos/bvanyushin/cardsharper/issues{/number}","pulls_url":"https://api.github.com/repos/bvanyushin/cardsharper/pulls{/number}","milestones_url":"https://api.github.com/repos/bvanyushin/cardsharper/milestones{/number}","notifications_url":"https://api.github.com/repos/bvanyushin/cardsharper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bvanyushin/cardsharper/labels{/name}","releases_url":"https://api.github.com/repos/bvanyushin/cardsharper/releases{/id}","created_at":"2015-01-12T14:37:00Z","updated_at":"2015-03-09T00:28:23Z","pushed_at":"2015-03-09T18:00:54Z","git_url":"git://github.com/bvanyushin/cardsharper.git","ssh_url":"git@github.com:bvanyushin/cardsharper.git","clone_url":"https://github.com/bvanyushin/cardsharper.git","svn_url":"https://github.com/bvanyushin/cardsharper","homepage":null,"size":632,"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/bvanyushin/cardsharper/pulls/11"},"html":{"href":"https://github.com/bvanyushin/cardsharper/pull/11"},"issue":{"href":"https://api.github.com/repos/bvanyushin/cardsharper/issues/11"},"comments":{"href":"https://api.github.com/repos/bvanyushin/cardsharper/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bvanyushin/cardsharper/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/bvanyushin/cardsharper/statuses/71041e69fbcc71e2c60dfc39b1cfd70fa88e5b85"}}}}