{"action":"created","comment":{"url":"https://api.github.com/repos/770580/flashcards/pulls/comments/60733330","id":60733330,"diff_hunk":"@@ -17,40 +17,114 @@\n     expect(card).to eq(card_r)\n   end\n \n-  describe \"if check result true add time in review_date\" do\n+  describe \"card quality\" do\n \n-    it \"12 hours\" do\n-      card.inc_review_date(true)\n-      expect(card.review_date).to be_within(2.seconds).of(Time.zone.now + 12.hours)\n+    it \"should be 5\" do\n+      answer_timer = 9\n+      input_text = \"Дом\"\n+      quality = card.answer_quality(input_text, answer_timer)\n+      expect(quality).to eq(5)\n     end\n \n-    it \"plus 3 days\" do\n-      card.update(level: 1)\n-      card.inc_review_date(true)\n-      expect(card.review_date).to be_within(2.seconds).of(Time.zone.now + 3.days)\n+    it \"should be 4\" do\n+      answer_timer = 13\n+      input_text = \"Дом\"\n+      quality = card.answer_quality(input_text, answer_timer)\n+      expect(quality).to eq(4)\n     end\n \n-    it \"plus 7 days\" do\n-      card.update(level: 2)\n-      card.inc_review_date(true)\n-      expect(card.review_date).to be_within(2.seconds).of(Time.zone.now + 7.days)\n+    it \"should be 3\" do\n+      answer_timer = 16\n+      input_text = \"Дом\"\n+      quality = card.answer_quality(input_text, answer_timer)\n+      expect(quality).to eq(3)\n     end\n \n-    it \"plus 2 weeks\" do\n-      card.update(level: 3)\n-      card.inc_review_date(true)\n-      expect(card.review_date).to be_within(2.seconds).of(Time.zone.now + 2.weeks)\n+    it \"should be 3 with misprint 1\" do\n+      answer_timer = 3\n+      input_text = \"Домм\"\n+      quality = card.answer_quality(input_text, answer_timer)\n+      expect(quality).to eq(3)\n     end\n \n-    it \"plus 1 month\" do\n-      card.update(level: 4)\n-      card.inc_review_date(true)\n-      expect(card.review_date).to be_within(2.seconds).of(Time.zone.now + 1.month)\n+    it \"should be 2 with misprint 2\" do\n+      answer_timer = 3\n+      input_text = \"Доммм\"\n+      quality = card.answer_quality(input_text, answer_timer)\n+      expect(quality).to eq(2)\n+    end\n+\n+    it \"should be 1 with misprint 3\" do\n+      answer_timer = 3\n+      input_text = \"Домммм\"\n+      quality = card.answer_quality(input_text, answer_timer)\n+      expect(quality).to eq(1)\n+    end\n+\n+    it \"should be 3 with misprint > 3\" do\n+      answer_timer = 3\n+      input_text = \"Доммммм\"\n+      quality = card.answer_quality(input_text, answer_timer)\n+      expect(quality).to eq(0)\n     end\n   end\n \n-  it \"if check result false 3 times review_date should be plus 12 hours\" do\n-    3.times { card.inc_review_date(false) }\n-    expect(card.review_date).to be_within(2.seconds).of(Time.zone.now + 12.hours)\n+  describe \"check result\" do\n+    answer_timer = 3\n+    it \"should be right\" do\n+      input_text = \"Дом\"\n+      result = card.check(input_text, answer_timer)\n+      expect(result).to eq(\"right\")\n+    end\n+\n+    it \"should be misprint 1\" do\n+      input_text = \"Домм\"\n+      result = card.check(input_text, answer_timer)\n+      expect(result).to eq(\"misprint\")\n+    end\n+\n+    it \"should be misprint 2\" do\n+      input_text = \"Доммм\"\n+      result = card.check(input_text, answer_timer)\n+      expect(result).to eq(\"misprint\")\n+    end\n+\n+    it \"should be misprint 3\" do\n+      input_text = \"Домммм\"\n+      result = card.check(input_text, answer_timer)\n+      expect(result).to eq(\"misprint\")\n+    end\n+\n+    it \"should be misprint 4\" do\n+      input_text = \"Домммммм\"\n+      result = card.check(input_text, answer_timer)\n+      expect(result).to eq(nil)\n+    end\n+  end\n+\n+  describe \"inc review date\" do\n+","path":"spec/models/card_spec.rb","position":113,"original_position":113,"commit_id":"7c2031597a3fa778dfdda6a5ae1f24497818fc17","original_commit_id":"7c2031597a3fa778dfdda6a5ae1f24497818fc17","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","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":"Extra empty line detected at block body beginning.","created_at":"2016-04-22T12:53:33Z","updated_at":"2016-04-22T12:53:33Z","html_url":"https://github.com/770580/flashcards/pull/16#discussion_r60733330","pull_request_url":"https://api.github.com/repos/770580/flashcards/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/770580/flashcards/pulls/comments/60733330"},"html":{"href":"https://github.com/770580/flashcards/pull/16#discussion_r60733330"},"pull_request":{"href":"https://api.github.com/repos/770580/flashcards/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/770580/flashcards/pulls/16","id":67505045,"html_url":"https://github.com/770580/flashcards/pull/16","diff_url":"https://github.com/770580/flashcards/pull/16.diff","patch_url":"https://github.com/770580/flashcards/pull/16.patch","issue_url":"https://api.github.com/repos/770580/flashcards/issues/16","number":16,"state":"open","locked":false,"title":"Seventeenth task","user":{"login":"770580","id":17593757,"avatar_url":"https://avatars.githubusercontent.com/u/17593757?v=3","gravatar_id":"","url":"https://api.github.com/users/770580","html_url":"https://github.com/770580","followers_url":"https://api.github.com/users/770580/followers","following_url":"https://api.github.com/users/770580/following{/other_user}","gists_url":"https://api.github.com/users/770580/gists{/gist_id}","starred_url":"https://api.github.com/users/770580/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/770580/subscriptions","organizations_url":"https://api.github.com/users/770580/orgs","repos_url":"https://api.github.com/users/770580/repos","events_url":"https://api.github.com/users/770580/events{/privacy}","received_events_url":"https://api.github.com/users/770580/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-22T12:41:15Z","updated_at":"2016-04-22T12:53:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ede071c5d4b6db61cef1b7ddd902c8c58c327c2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/770580/flashcards/pulls/16/commits","review_comments_url":"https://api.github.com/repos/770580/flashcards/pulls/16/comments","review_comment_url":"https://api.github.com/repos/770580/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/770580/flashcards/issues/16/comments","statuses_url":"https://api.github.com/repos/770580/flashcards/statuses/7c2031597a3fa778dfdda6a5ae1f24497818fc17","head":{"label":"770580:seventeenth-task","ref":"seventeenth-task","sha":"7c2031597a3fa778dfdda6a5ae1f24497818fc17","user":{"login":"770580","id":17593757,"avatar_url":"https://avatars.githubusercontent.com/u/17593757?v=3","gravatar_id":"","url":"https://api.github.com/users/770580","html_url":"https://github.com/770580","followers_url":"https://api.github.com/users/770580/followers","following_url":"https://api.github.com/users/770580/following{/other_user}","gists_url":"https://api.github.com/users/770580/gists{/gist_id}","starred_url":"https://api.github.com/users/770580/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/770580/subscriptions","organizations_url":"https://api.github.com/users/770580/orgs","repos_url":"https://api.github.com/users/770580/repos","events_url":"https://api.github.com/users/770580/events{/privacy}","received_events_url":"https://api.github.com/users/770580/received_events","type":"User","site_admin":false},"repo":{"id":54706388,"name":"flashcards","full_name":"770580/flashcards","owner":{"login":"770580","id":17593757,"avatar_url":"https://avatars.githubusercontent.com/u/17593757?v=3","gravatar_id":"","url":"https://api.github.com/users/770580","html_url":"https://github.com/770580","followers_url":"https://api.github.com/users/770580/followers","following_url":"https://api.github.com/users/770580/following{/other_user}","gists_url":"https://api.github.com/users/770580/gists{/gist_id}","starred_url":"https://api.github.com/users/770580/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/770580/subscriptions","organizations_url":"https://api.github.com/users/770580/orgs","repos_url":"https://api.github.com/users/770580/repos","events_url":"https://api.github.com/users/770580/events{/privacy}","received_events_url":"https://api.github.com/users/770580/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/770580/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/770580/flashcards","forks_url":"https://api.github.com/repos/770580/flashcards/forks","keys_url":"https://api.github.com/repos/770580/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/770580/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/770580/flashcards/teams","hooks_url":"https://api.github.com/repos/770580/flashcards/hooks","issue_events_url":"https://api.github.com/repos/770580/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/770580/flashcards/events","assignees_url":"https://api.github.com/repos/770580/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/770580/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/770580/flashcards/tags","blobs_url":"https://api.github.com/repos/770580/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/770580/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/770580/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/770580/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/770580/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/770580/flashcards/languages","stargazers_url":"https://api.github.com/repos/770580/flashcards/stargazers","contributors_url":"https://api.github.com/repos/770580/flashcards/contributors","subscribers_url":"https://api.github.com/repos/770580/flashcards/subscribers","subscription_url":"https://api.github.com/repos/770580/flashcards/subscription","commits_url":"https://api.github.com/repos/770580/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/770580/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/770580/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/770580/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/770580/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/770580/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/770580/flashcards/merges","archive_url":"https://api.github.com/repos/770580/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/770580/flashcards/downloads","issues_url":"https://api.github.com/repos/770580/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/770580/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/770580/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/770580/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/770580/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/770580/flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/770580/flashcards/deployments","created_at":"2016-03-25T08:42:35Z","updated_at":"2016-03-27T08:00:02Z","pushed_at":"2016-04-22T12:53:28Z","git_url":"git://github.com/770580/flashcards.git","ssh_url":"git@github.com:770580/flashcards.git","clone_url":"https://github.com/770580/flashcards.git","svn_url":"https://github.com/770580/flashcards","homepage":null,"size":414,"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":"770580:master","ref":"master","sha":"f0d20ecc2d0648501a89e3e9f31e93c49e877226","user":{"login":"770580","id":17593757,"avatar_url":"https://avatars.githubusercontent.com/u/17593757?v=3","gravatar_id":"","url":"https://api.github.com/users/770580","html_url":"https://github.com/770580","followers_url":"https://api.github.com/users/770580/followers","following_url":"https://api.github.com/users/770580/following{/other_user}","gists_url":"https://api.github.com/users/770580/gists{/gist_id}","starred_url":"https://api.github.com/users/770580/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/770580/subscriptions","organizations_url":"https://api.github.com/users/770580/orgs","repos_url":"https://api.github.com/users/770580/repos","events_url":"https://api.github.com/users/770580/events{/privacy}","received_events_url":"https://api.github.com/users/770580/received_events","type":"User","site_admin":false},"repo":{"id":54706388,"name":"flashcards","full_name":"770580/flashcards","owner":{"login":"770580","id":17593757,"avatar_url":"https://avatars.githubusercontent.com/u/17593757?v=3","gravatar_id":"","url":"https://api.github.com/users/770580","html_url":"https://github.com/770580","followers_url":"https://api.github.com/users/770580/followers","following_url":"https://api.github.com/users/770580/following{/other_user}","gists_url":"https://api.github.com/users/770580/gists{/gist_id}","starred_url":"https://api.github.com/users/770580/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/770580/subscriptions","organizations_url":"https://api.github.com/users/770580/orgs","repos_url":"https://api.github.com/users/770580/repos","events_url":"https://api.github.com/users/770580/events{/privacy}","received_events_url":"https://api.github.com/users/770580/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/770580/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/770580/flashcards","forks_url":"https://api.github.com/repos/770580/flashcards/forks","keys_url":"https://api.github.com/repos/770580/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/770580/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/770580/flashcards/teams","hooks_url":"https://api.github.com/repos/770580/flashcards/hooks","issue_events_url":"https://api.github.com/repos/770580/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/770580/flashcards/events","assignees_url":"https://api.github.com/repos/770580/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/770580/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/770580/flashcards/tags","blobs_url":"https://api.github.com/repos/770580/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/770580/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/770580/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/770580/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/770580/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/770580/flashcards/languages","stargazers_url":"https://api.github.com/repos/770580/flashcards/stargazers","contributors_url":"https://api.github.com/repos/770580/flashcards/contributors","subscribers_url":"https://api.github.com/repos/770580/flashcards/subscribers","subscription_url":"https://api.github.com/repos/770580/flashcards/subscription","commits_url":"https://api.github.com/repos/770580/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/770580/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/770580/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/770580/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/770580/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/770580/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/770580/flashcards/merges","archive_url":"https://api.github.com/repos/770580/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/770580/flashcards/downloads","issues_url":"https://api.github.com/repos/770580/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/770580/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/770580/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/770580/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/770580/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/770580/flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/770580/flashcards/deployments","created_at":"2016-03-25T08:42:35Z","updated_at":"2016-03-27T08:00:02Z","pushed_at":"2016-04-22T12:53:28Z","git_url":"git://github.com/770580/flashcards.git","ssh_url":"git@github.com:770580/flashcards.git","clone_url":"https://github.com/770580/flashcards.git","svn_url":"https://github.com/770580/flashcards","homepage":null,"size":414,"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/770580/flashcards/pulls/16"},"html":{"href":"https://github.com/770580/flashcards/pull/16"},"issue":{"href":"https://api.github.com/repos/770580/flashcards/issues/16"},"comments":{"href":"https://api.github.com/repos/770580/flashcards/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/770580/flashcards/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/770580/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/770580/flashcards/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/770580/flashcards/statuses/7c2031597a3fa778dfdda6a5ae1f24497818fc17"}}}}