{"action":"created","comment":{"url":"https://api.github.com/repos/sanjcho/Flashcards/pulls/comments/53304064","id":53304064,"diff_hunk":"@@ -28,52 +28,60 @@\n       end\n     end\n \n-    context \"#update_card_attr_right! method\" do\n+    context \"#review_date_calc\" do\n+      \n+      it \"must return a hash with repeate:, review_date: and interval: if q < 3\" do\n+        @card.repeate = 4\n+        @card.interval = 6\n+        ef_old = @card.e_factor\n+        expect(@comparator.review_date_calc(2)).to include(repeate: 1)\n+        expect(@comparator.review_date_calc(2)).to include(:review_date)        \n+        expect(@comparator.review_date_calc(2)).to include(interval: 1)\n+      end\n+\n+      it \"must return a hash with repeate:, review_date:, e_factor: and interval: if q >= 3\" do\n+        @card.repeate = 4\n+        @card.interval = 6\n+        expect(@comparator.review_date_calc(5)).to include(repeate: @card.repeate+1)\n+        expect(@comparator.review_date_calc(5)).to include(:review_date)        \n+        expect(@comparator.review_date_calc(5)).to include(:interval)\n+        expect(@comparator.review_date_calc(5)).to include(:e_factor)\n+      end\n+    end\n+    context \"#interval_calc\" do\n      \n-      it \"#update_card_attr_right! must increase card.correct on 1 and review_date on 12 hours if there is a first correct answer\" do\n-        @comparator.update_card_attr_right!(@card)\n-        expect(Card.find(@card.id).review_date.beginning_of_minute).to eq 12.hours.from_now.beginning_of_minute\n-        expect(Card.find(@card.id).correct).to be 1\n-      end\n-      it \"#update_card_attr_right! must increase card.correct on 1 and review_date on 3 days if there is a 2nd correct answer\" do\n-        @card.update(correct: 1)\n-        @comparator.update_card_attr_right!(@card)\n-        expect(Card.find(@card.id).review_date.beginning_of_minute).to eq 3.days.from_now.beginning_of_minute\n-        expect(Card.find(@card.id).correct).to be 2\n-      end\n-      it \"#update_card_attr_right! must increase card.correct on 1 and review_date on 7 days if there is a 3rd correct answer\" do\n-        @card.update(correct: 2)\n-        @comparator.update_card_attr_right!(@card)\n-        expect(Card.find(@card.id).review_date.beginning_of_minute).to eq 7.days.from_now.beginning_of_minute\n-        expect(Card.find(@card.id).correct).to be 3\n-      end\n-      it \"#update_card_attr_right! must increase card.correct on 1 and review_date on 14 days if there is a 4th correct answer\" do\n-        @card.update(correct: 3)\n-        @comparator.update_card_attr_right!(@card)\n-        expect(Card.find(@card.id).review_date.beginning_of_minute).to eq 14.days.from_now.beginning_of_minute\n-        expect(Card.find(@card.id).correct).to be 4\n-      end\n-      it \"#update_card_attr_right! must increase card.correct on 1 and review_date on 14 days if there is a 4th correct answer\" do\n-        @card.update(correct: 4)\n-        @comparator.update_card_attr_right!(@card)\n-        expect(Card.find(@card.id).review_date.beginning_of_minute).to eq 1.month.from_now.beginning_of_minute\n-        expect(Card.find(@card.id).correct).to be 5\n+      it \"must return 1 if repeate = 1, interval and efactor is no affect\" do\n+        expect(@comparator.interval_calc( 6, 2.5, 1 )).to be == 1\n+      end\n+\n+      it \"must return 6 if repeate = 2, interval and efactor is no affect\" do\n+        expect(@comparator.interval_calc( 6, 2.5, 2 )).to be == 6\n+      end\n+\n+      it \"must return interval * efactor if repeate = 3, interval = 6 and efactor is 2.5\" do\n+        expect(@comparator.interval_calc( 6, 2.5, 3 )).to be == 6*2.5","path":"spec/services/card_comparator_spec.rb","position":64,"original_position":64,"commit_id":"03043091548f45482e48c8d720159b0f97f63eca","original_commit_id":"03043091548f45482e48c8d720159b0f97f63eca","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":"Surrounding space missing for operator `*`.<br>Space inside parentheses detected.","created_at":"2016-02-18T11:49:35Z","updated_at":"2016-02-18T11:49:35Z","html_url":"https://github.com/sanjcho/Flashcards/pull/18#discussion_r53304064","pull_request_url":"https://api.github.com/repos/sanjcho/Flashcards/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/sanjcho/Flashcards/pulls/comments/53304064"},"html":{"href":"https://github.com/sanjcho/Flashcards/pull/18#discussion_r53304064"},"pull_request":{"href":"https://api.github.com/repos/sanjcho/Flashcards/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/sanjcho/Flashcards/pulls/18","id":59754020,"html_url":"https://github.com/sanjcho/Flashcards/pull/18","diff_url":"https://github.com/sanjcho/Flashcards/pull/18.diff","patch_url":"https://github.com/sanjcho/Flashcards/pull/18.patch","issue_url":"https://api.github.com/repos/sanjcho/Flashcards/issues/18","number":18,"state":"open","locked":false,"title":"17th task","user":{"login":"sanjcho","id":11830303,"avatar_url":"https://avatars.githubusercontent.com/u/11830303?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjcho","html_url":"https://github.com/sanjcho","followers_url":"https://api.github.com/users/sanjcho/followers","following_url":"https://api.github.com/users/sanjcho/following{/other_user}","gists_url":"https://api.github.com/users/sanjcho/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjcho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjcho/subscriptions","organizations_url":"https://api.github.com/users/sanjcho/orgs","repos_url":"https://api.github.com/users/sanjcho/repos","events_url":"https://api.github.com/users/sanjcho/events{/privacy}","received_events_url":"https://api.github.com/users/sanjcho/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-18T05:49:53Z","updated_at":"2016-02-18T11:49:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sanjcho/Flashcards/pulls/18/commits","review_comments_url":"https://api.github.com/repos/sanjcho/Flashcards/pulls/18/comments","review_comment_url":"https://api.github.com/repos/sanjcho/Flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sanjcho/Flashcards/issues/18/comments","statuses_url":"https://api.github.com/repos/sanjcho/Flashcards/statuses/03043091548f45482e48c8d720159b0f97f63eca","head":{"label":"sanjcho:17th-task","ref":"17th-task","sha":"03043091548f45482e48c8d720159b0f97f63eca","user":{"login":"sanjcho","id":11830303,"avatar_url":"https://avatars.githubusercontent.com/u/11830303?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjcho","html_url":"https://github.com/sanjcho","followers_url":"https://api.github.com/users/sanjcho/followers","following_url":"https://api.github.com/users/sanjcho/following{/other_user}","gists_url":"https://api.github.com/users/sanjcho/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjcho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjcho/subscriptions","organizations_url":"https://api.github.com/users/sanjcho/orgs","repos_url":"https://api.github.com/users/sanjcho/repos","events_url":"https://api.github.com/users/sanjcho/events{/privacy}","received_events_url":"https://api.github.com/users/sanjcho/received_events","type":"User","site_admin":false},"repo":{"id":49260824,"name":"Flashcards","full_name":"sanjcho/Flashcards","owner":{"login":"sanjcho","id":11830303,"avatar_url":"https://avatars.githubusercontent.com/u/11830303?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjcho","html_url":"https://github.com/sanjcho","followers_url":"https://api.github.com/users/sanjcho/followers","following_url":"https://api.github.com/users/sanjcho/following{/other_user}","gists_url":"https://api.github.com/users/sanjcho/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjcho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjcho/subscriptions","organizations_url":"https://api.github.com/users/sanjcho/orgs","repos_url":"https://api.github.com/users/sanjcho/repos","events_url":"https://api.github.com/users/sanjcho/events{/privacy}","received_events_url":"https://api.github.com/users/sanjcho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sanjcho/Flashcards","description":"","fork":false,"url":"https://api.github.com/repos/sanjcho/Flashcards","forks_url":"https://api.github.com/repos/sanjcho/Flashcards/forks","keys_url":"https://api.github.com/repos/sanjcho/Flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanjcho/Flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanjcho/Flashcards/teams","hooks_url":"https://api.github.com/repos/sanjcho/Flashcards/hooks","issue_events_url":"https://api.github.com/repos/sanjcho/Flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/sanjcho/Flashcards/events","assignees_url":"https://api.github.com/repos/sanjcho/Flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/sanjcho/Flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/sanjcho/Flashcards/tags","blobs_url":"https://api.github.com/repos/sanjcho/Flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanjcho/Flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanjcho/Flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanjcho/Flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanjcho/Flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/sanjcho/Flashcards/languages","stargazers_url":"https://api.github.com/repos/sanjcho/Flashcards/stargazers","contributors_url":"https://api.github.com/repos/sanjcho/Flashcards/contributors","subscribers_url":"https://api.github.com/repos/sanjcho/Flashcards/subscribers","subscription_url":"https://api.github.com/repos/sanjcho/Flashcards/subscription","commits_url":"https://api.github.com/repos/sanjcho/Flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanjcho/Flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanjcho/Flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanjcho/Flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanjcho/Flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/sanjcho/Flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanjcho/Flashcards/merges","archive_url":"https://api.github.com/repos/sanjcho/Flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanjcho/Flashcards/downloads","issues_url":"https://api.github.com/repos/sanjcho/Flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/sanjcho/Flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/sanjcho/Flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/sanjcho/Flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanjcho/Flashcards/labels{/name}","releases_url":"https://api.github.com/repos/sanjcho/Flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/sanjcho/Flashcards/deployments","created_at":"2016-01-08T08:46:54Z","updated_at":"2016-01-12T07:41:12Z","pushed_at":"2016-02-18T11:49:29Z","git_url":"git://github.com/sanjcho/Flashcards.git","ssh_url":"git@github.com:sanjcho/Flashcards.git","clone_url":"https://github.com/sanjcho/Flashcards.git","svn_url":"https://github.com/sanjcho/Flashcards","homepage":null,"size":391,"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":"sanjcho:master","ref":"master","sha":"0f511612e0a481f37505817b95b800f2cde23f4e","user":{"login":"sanjcho","id":11830303,"avatar_url":"https://avatars.githubusercontent.com/u/11830303?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjcho","html_url":"https://github.com/sanjcho","followers_url":"https://api.github.com/users/sanjcho/followers","following_url":"https://api.github.com/users/sanjcho/following{/other_user}","gists_url":"https://api.github.com/users/sanjcho/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjcho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjcho/subscriptions","organizations_url":"https://api.github.com/users/sanjcho/orgs","repos_url":"https://api.github.com/users/sanjcho/repos","events_url":"https://api.github.com/users/sanjcho/events{/privacy}","received_events_url":"https://api.github.com/users/sanjcho/received_events","type":"User","site_admin":false},"repo":{"id":49260824,"name":"Flashcards","full_name":"sanjcho/Flashcards","owner":{"login":"sanjcho","id":11830303,"avatar_url":"https://avatars.githubusercontent.com/u/11830303?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjcho","html_url":"https://github.com/sanjcho","followers_url":"https://api.github.com/users/sanjcho/followers","following_url":"https://api.github.com/users/sanjcho/following{/other_user}","gists_url":"https://api.github.com/users/sanjcho/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjcho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjcho/subscriptions","organizations_url":"https://api.github.com/users/sanjcho/orgs","repos_url":"https://api.github.com/users/sanjcho/repos","events_url":"https://api.github.com/users/sanjcho/events{/privacy}","received_events_url":"https://api.github.com/users/sanjcho/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sanjcho/Flashcards","description":"","fork":false,"url":"https://api.github.com/repos/sanjcho/Flashcards","forks_url":"https://api.github.com/repos/sanjcho/Flashcards/forks","keys_url":"https://api.github.com/repos/sanjcho/Flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanjcho/Flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanjcho/Flashcards/teams","hooks_url":"https://api.github.com/repos/sanjcho/Flashcards/hooks","issue_events_url":"https://api.github.com/repos/sanjcho/Flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/sanjcho/Flashcards/events","assignees_url":"https://api.github.com/repos/sanjcho/Flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/sanjcho/Flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/sanjcho/Flashcards/tags","blobs_url":"https://api.github.com/repos/sanjcho/Flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanjcho/Flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanjcho/Flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanjcho/Flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanjcho/Flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/sanjcho/Flashcards/languages","stargazers_url":"https://api.github.com/repos/sanjcho/Flashcards/stargazers","contributors_url":"https://api.github.com/repos/sanjcho/Flashcards/contributors","subscribers_url":"https://api.github.com/repos/sanjcho/Flashcards/subscribers","subscription_url":"https://api.github.com/repos/sanjcho/Flashcards/subscription","commits_url":"https://api.github.com/repos/sanjcho/Flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanjcho/Flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanjcho/Flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanjcho/Flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanjcho/Flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/sanjcho/Flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanjcho/Flashcards/merges","archive_url":"https://api.github.com/repos/sanjcho/Flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanjcho/Flashcards/downloads","issues_url":"https://api.github.com/repos/sanjcho/Flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/sanjcho/Flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/sanjcho/Flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/sanjcho/Flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanjcho/Flashcards/labels{/name}","releases_url":"https://api.github.com/repos/sanjcho/Flashcards/releases{/id}","deployments_url":"https://api.github.com/repos/sanjcho/Flashcards/deployments","created_at":"2016-01-08T08:46:54Z","updated_at":"2016-01-12T07:41:12Z","pushed_at":"2016-02-18T11:49:29Z","git_url":"git://github.com/sanjcho/Flashcards.git","ssh_url":"git@github.com:sanjcho/Flashcards.git","clone_url":"https://github.com/sanjcho/Flashcards.git","svn_url":"https://github.com/sanjcho/Flashcards","homepage":null,"size":391,"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/sanjcho/Flashcards/pulls/18"},"html":{"href":"https://github.com/sanjcho/Flashcards/pull/18"},"issue":{"href":"https://api.github.com/repos/sanjcho/Flashcards/issues/18"},"comments":{"href":"https://api.github.com/repos/sanjcho/Flashcards/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/sanjcho/Flashcards/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/sanjcho/Flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sanjcho/Flashcards/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/sanjcho/Flashcards/statuses/03043091548f45482e48c8d720159b0f97f63eca"}}}}