{"action":"created","comment":{"url":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/comments/93862821","pull_request_review_id":14396358,"id":93862821,"diff_hunk":"@@ -3,66 +3,85 @@\n require \"check_translation.rb\"\n \n RSpec.describe Card, type: :model do\n+\n+  def translation(params)\n+      CheckTranslation.call(card: card, params: params)\n+  end\n+\n   context 'check translation' do\n     let!(:card) { create(:card) } \n   \n-    it \"right translation\" do\n+    it \"first translation +24\" do\n       result = translation({ text: 'not' }) \n       expect(result).to be_a_success\n-      expect(card.right_checks).to eq(1)       \n+      expect(card.checks).to eq(1)    \n+      expect(card.review_date.strftime('%F %H:%M')).to eq((Time.zone.now. + 24.hours).strftime('%F %H:%M'))  \n+      expect(card.review_time).to eq(24)\n+      expect(card.ef).to eq(2.5)      \n     end\n \n-    it \"max right translation\" do\n-      card.right_checks = 5      \n+    it \"second translation +144\" do\n+      card.checks = 1\n       result = translation({ text: 'not' }) \n       expect(result).to be_a_success\n-      expect(card.right_checks).to eq(5)       \n+      expect(card.checks).to eq(2)    \n+      expect(card.review_date.strftime('%F %H:%M')).to eq((Time.zone.now. + 144.hours).strftime('%F %H:%M'))   \n+      expect(card.review_time).to eq(144)\n+      expect(card.ef).to eq(2.5)       \n     end\n-\n-    it \"right translation change of date\" do\n-      card.right_checks = 0      \n-      time = [12, 72, 168, 336, 672]\n-      i = 0\n-      5.times { \n-        review = card.review_date\n-        result = translation({ text: 'not' })       \n-        expect(card.review_date.strftime('%F %H:%M')).to eq((Time.zone.now. + time[i].hours).strftime('%F %H:%M'))\n-        i += 1 \n-        expect(card.right_checks).to eq(i)          \n-      }       \n+    \n+    it 'ef must be greater that 1.3' do \n+      10.times {\n+        datejump = Card.find(card.id).review_date\n+        Timecop.travel(datejump)        \n+        result = translation({ text: 'not' })\n+        expect(card.ef).to be >= 1.3\n+        Timecop.return   \n+      }\n     end\n+  end    \n   \n-    it \"wrong translation\" do\n-      card.right_checks = 1\n-      result = translation({ text: 'yes' }) \n-      expect(result).not_to be_a_success\n-      expect(card.wrong_checks).to eq(1)  \n+  context \"set new time in all cases\" do\n+    let!(:card) { create(:card) }     \n+    before do\n+      2.times {\n+        datejump = Card.find(card.id).review_date\n+        Timecop.travel(datejump)        \n+        result = translation({ text: 'not' })\n+        Timecop.return   \n+      }           \n     end\n \n-    it \"wrong translation reduce number of right cheks and change date back\" do\n-      card.right_checks = 5\n-      card.review_date = Time.now + 672.hours\n-      time = [0, 12, 72, 168, 336]\n-      i = 4\n-      4.times { \n-        review = card.review_date\n-        3.times { result = translation({ text: 'yes' })  }\n-        expect(card.right_checks).to eq(i)  \n-        expect(card.review_date.strftime('%F %H:%M')).to eq((Time.zone.now. + time[i].hours).strftime('%F %H:%M'))                \n-        i -= 1 \n-      }                     \n+    it \"right answer set time for perfect response (after first two checks)\" do   \n+      result = translation({ text: 'not', time: '1' }) \n+      expect(card.ef).to eq(2.6)\n+      expect(card.review_time).to eq(375)\n     end\n \n-    it \"wrong translation do not countig if we have 0 right cheks\" do\n-      card.right_checks = 0\n-      3.times { result = translation({ text: 'yes' }) \n-      expect(result).not_to be_a_success }\n-      expect(card.right_checks).to eq(0)   \n-      expect(card.wrong_checks).to eq(0)         \n+    it \"right answer set time for correct response after a hesitation (after first two checks)\" do\n+      result = translation({ text: 'not', time: '5' })  \n+      expect(card.ef).to eq(2.5)\n+      expect(card.review_time).to eq(360)\n     end\n-  \n-    def translation(params)\n-      CheckTranslation.call(card: card, params: params)\n+\n+    it \"right answer set time for correct response recalled with serious difficulty (after first two checks)\" do     \n+      result = translation({ text: 'not', time: '10' }) \n+      expect(card.review_time).to eq(340)            \n+    end\n+\n+    it \"wrong answer set time for incorrect response; where the correct one seemed easy to recall (after first two checks)\" do      \n+      result = translation({ text: 'no' })       \n+      expect(card.review_time).to eq(314)        \n+    end\n+\n+    it \"wrong answer set time for incorrect response; the correct one remembered (after first two checks)\" do      ","path":"spec/interactors/card_spec.rb","position":118,"original_position":118,"commit_id":"de82e7aa3f226d6425f30c8c4a0f5c143fb0ae11","original_commit_id":"de82e7aa3f226d6425f30c8c4a0f5c143fb0ae11","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":"Trailing whitespace detected.","created_at":"2016-12-26T11:57:40Z","updated_at":"2016-12-26T11:57:40Z","html_url":"https://github.com/ValentinAndreev/flashcards/pull/142#discussion_r93862821","pull_request_url":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/142","_links":{"self":{"href":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/comments/93862821"},"html":{"href":"https://github.com/ValentinAndreev/flashcards/pull/142#discussion_r93862821"},"pull_request":{"href":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/142"}}},"pull_request":{"url":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/142","id":99364691,"html_url":"https://github.com/ValentinAndreev/flashcards/pull/142","diff_url":"https://github.com/ValentinAndreev/flashcards/pull/142.diff","patch_url":"https://github.com/ValentinAndreev/flashcards/pull/142.patch","issue_url":"https://api.github.com/repos/ValentinAndreev/flashcards/issues/142","number":142,"state":"open","locked":false,"title":"Supermemo","user":{"login":"ValentinAndreev","id":19556071,"avatar_url":"https://avatars.githubusercontent.com/u/19556071?v=3","gravatar_id":"","url":"https://api.github.com/users/ValentinAndreev","html_url":"https://github.com/ValentinAndreev","followers_url":"https://api.github.com/users/ValentinAndreev/followers","following_url":"https://api.github.com/users/ValentinAndreev/following{/other_user}","gists_url":"https://api.github.com/users/ValentinAndreev/gists{/gist_id}","starred_url":"https://api.github.com/users/ValentinAndreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ValentinAndreev/subscriptions","organizations_url":"https://api.github.com/users/ValentinAndreev/orgs","repos_url":"https://api.github.com/users/ValentinAndreev/repos","events_url":"https://api.github.com/users/ValentinAndreev/events{/privacy}","received_events_url":"https://api.github.com/users/ValentinAndreev/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-26T11:57:31Z","updated_at":"2016-12-26T11:57:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48d2731bc5a90512d4e2c0647af7cac160b08ed5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/142/commits","review_comments_url":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/142/comments","review_comment_url":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ValentinAndreev/flashcards/issues/142/comments","statuses_url":"https://api.github.com/repos/ValentinAndreev/flashcards/statuses/de82e7aa3f226d6425f30c8c4a0f5c143fb0ae11","head":{"label":"ValentinAndreev:supermemo","ref":"supermemo","sha":"de82e7aa3f226d6425f30c8c4a0f5c143fb0ae11","user":{"login":"ValentinAndreev","id":19556071,"avatar_url":"https://avatars.githubusercontent.com/u/19556071?v=3","gravatar_id":"","url":"https://api.github.com/users/ValentinAndreev","html_url":"https://github.com/ValentinAndreev","followers_url":"https://api.github.com/users/ValentinAndreev/followers","following_url":"https://api.github.com/users/ValentinAndreev/following{/other_user}","gists_url":"https://api.github.com/users/ValentinAndreev/gists{/gist_id}","starred_url":"https://api.github.com/users/ValentinAndreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ValentinAndreev/subscriptions","organizations_url":"https://api.github.com/users/ValentinAndreev/orgs","repos_url":"https://api.github.com/users/ValentinAndreev/repos","events_url":"https://api.github.com/users/ValentinAndreev/events{/privacy}","received_events_url":"https://api.github.com/users/ValentinAndreev/received_events","type":"User","site_admin":false},"repo":{"id":73261209,"name":"flashcards","full_name":"ValentinAndreev/flashcards","owner":{"login":"ValentinAndreev","id":19556071,"avatar_url":"https://avatars.githubusercontent.com/u/19556071?v=3","gravatar_id":"","url":"https://api.github.com/users/ValentinAndreev","html_url":"https://github.com/ValentinAndreev","followers_url":"https://api.github.com/users/ValentinAndreev/followers","following_url":"https://api.github.com/users/ValentinAndreev/following{/other_user}","gists_url":"https://api.github.com/users/ValentinAndreev/gists{/gist_id}","starred_url":"https://api.github.com/users/ValentinAndreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ValentinAndreev/subscriptions","organizations_url":"https://api.github.com/users/ValentinAndreev/orgs","repos_url":"https://api.github.com/users/ValentinAndreev/repos","events_url":"https://api.github.com/users/ValentinAndreev/events{/privacy}","received_events_url":"https://api.github.com/users/ValentinAndreev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ValentinAndreev/flashcards","description":null,"fork":false,"url":"https://api.github.com/repos/ValentinAndreev/flashcards","forks_url":"https://api.github.com/repos/ValentinAndreev/flashcards/forks","keys_url":"https://api.github.com/repos/ValentinAndreev/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ValentinAndreev/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ValentinAndreev/flashcards/teams","hooks_url":"https://api.github.com/repos/ValentinAndreev/flashcards/hooks","issue_events_url":"https://api.github.com/repos/ValentinAndreev/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/ValentinAndreev/flashcards/events","assignees_url":"https://api.github.com/repos/ValentinAndreev/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/ValentinAndreev/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/ValentinAndreev/flashcards/tags","blobs_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ValentinAndreev/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/ValentinAndreev/flashcards/languages","stargazers_url":"https://api.github.com/repos/ValentinAndreev/flashcards/stargazers","contributors_url":"https://api.github.com/repos/ValentinAndreev/flashcards/contributors","subscribers_url":"https://api.github.com/repos/ValentinAndreev/flashcards/subscribers","subscription_url":"https://api.github.com/repos/ValentinAndreev/flashcards/subscription","commits_url":"https://api.github.com/repos/ValentinAndreev/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/ValentinAndreev/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/ValentinAndreev/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/ValentinAndreev/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/ValentinAndreev/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ValentinAndreev/flashcards/merges","archive_url":"https://api.github.com/repos/ValentinAndreev/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ValentinAndreev/flashcards/downloads","issues_url":"https://api.github.com/repos/ValentinAndreev/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/ValentinAndreev/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/ValentinAndreev/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ValentinAndreev/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/ValentinAndreev/flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/ValentinAndreev/flashcards/deployments","created_at":"2016-11-09T07:30:25Z","updated_at":"2016-12-12T06:47:47Z","pushed_at":"2016-12-26T11:57:32Z","git_url":"git://github.com/ValentinAndreev/flashcards.git","ssh_url":"git@github.com:ValentinAndreev/flashcards.git","clone_url":"https://github.com/ValentinAndreev/flashcards.git","svn_url":"https://github.com/ValentinAndreev/flashcards","homepage":null,"size":238,"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":"ValentinAndreev:master","ref":"master","sha":"f431bbdbfbe7f81ffa22108cd4a8e44286666d73","user":{"login":"ValentinAndreev","id":19556071,"avatar_url":"https://avatars.githubusercontent.com/u/19556071?v=3","gravatar_id":"","url":"https://api.github.com/users/ValentinAndreev","html_url":"https://github.com/ValentinAndreev","followers_url":"https://api.github.com/users/ValentinAndreev/followers","following_url":"https://api.github.com/users/ValentinAndreev/following{/other_user}","gists_url":"https://api.github.com/users/ValentinAndreev/gists{/gist_id}","starred_url":"https://api.github.com/users/ValentinAndreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ValentinAndreev/subscriptions","organizations_url":"https://api.github.com/users/ValentinAndreev/orgs","repos_url":"https://api.github.com/users/ValentinAndreev/repos","events_url":"https://api.github.com/users/ValentinAndreev/events{/privacy}","received_events_url":"https://api.github.com/users/ValentinAndreev/received_events","type":"User","site_admin":false},"repo":{"id":73261209,"name":"flashcards","full_name":"ValentinAndreev/flashcards","owner":{"login":"ValentinAndreev","id":19556071,"avatar_url":"https://avatars.githubusercontent.com/u/19556071?v=3","gravatar_id":"","url":"https://api.github.com/users/ValentinAndreev","html_url":"https://github.com/ValentinAndreev","followers_url":"https://api.github.com/users/ValentinAndreev/followers","following_url":"https://api.github.com/users/ValentinAndreev/following{/other_user}","gists_url":"https://api.github.com/users/ValentinAndreev/gists{/gist_id}","starred_url":"https://api.github.com/users/ValentinAndreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ValentinAndreev/subscriptions","organizations_url":"https://api.github.com/users/ValentinAndreev/orgs","repos_url":"https://api.github.com/users/ValentinAndreev/repos","events_url":"https://api.github.com/users/ValentinAndreev/events{/privacy}","received_events_url":"https://api.github.com/users/ValentinAndreev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ValentinAndreev/flashcards","description":null,"fork":false,"url":"https://api.github.com/repos/ValentinAndreev/flashcards","forks_url":"https://api.github.com/repos/ValentinAndreev/flashcards/forks","keys_url":"https://api.github.com/repos/ValentinAndreev/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ValentinAndreev/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ValentinAndreev/flashcards/teams","hooks_url":"https://api.github.com/repos/ValentinAndreev/flashcards/hooks","issue_events_url":"https://api.github.com/repos/ValentinAndreev/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/ValentinAndreev/flashcards/events","assignees_url":"https://api.github.com/repos/ValentinAndreev/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/ValentinAndreev/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/ValentinAndreev/flashcards/tags","blobs_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ValentinAndreev/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/ValentinAndreev/flashcards/languages","stargazers_url":"https://api.github.com/repos/ValentinAndreev/flashcards/stargazers","contributors_url":"https://api.github.com/repos/ValentinAndreev/flashcards/contributors","subscribers_url":"https://api.github.com/repos/ValentinAndreev/flashcards/subscribers","subscription_url":"https://api.github.com/repos/ValentinAndreev/flashcards/subscription","commits_url":"https://api.github.com/repos/ValentinAndreev/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/ValentinAndreev/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/ValentinAndreev/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/ValentinAndreev/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/ValentinAndreev/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/ValentinAndreev/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ValentinAndreev/flashcards/merges","archive_url":"https://api.github.com/repos/ValentinAndreev/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ValentinAndreev/flashcards/downloads","issues_url":"https://api.github.com/repos/ValentinAndreev/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/ValentinAndreev/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/ValentinAndreev/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ValentinAndreev/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/ValentinAndreev/flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/ValentinAndreev/flashcards/deployments","created_at":"2016-11-09T07:30:25Z","updated_at":"2016-12-12T06:47:47Z","pushed_at":"2016-12-26T11:57:32Z","git_url":"git://github.com/ValentinAndreev/flashcards.git","ssh_url":"git@github.com:ValentinAndreev/flashcards.git","clone_url":"https://github.com/ValentinAndreev/flashcards.git","svn_url":"https://github.com/ValentinAndreev/flashcards","homepage":null,"size":238,"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/ValentinAndreev/flashcards/pulls/142"},"html":{"href":"https://github.com/ValentinAndreev/flashcards/pull/142"},"issue":{"href":"https://api.github.com/repos/ValentinAndreev/flashcards/issues/142"},"comments":{"href":"https://api.github.com/repos/ValentinAndreev/flashcards/issues/142/comments"},"review_comments":{"href":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/142/comments"},"review_comment":{"href":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ValentinAndreev/flashcards/pulls/142/commits"},"statuses":{"href":"https://api.github.com/repos/ValentinAndreev/flashcards/statuses/de82e7aa3f226d6425f30c8c4a0f5c143fb0ae11"}}}}
{"actor":{"display_login":"houndci-bot"}}