{"action":"created","comment":{"url":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/comments/62643043","id":62643043,"diff_hunk":"@@ -370,56 +370,6 @@\n         expect(response).to render_template('posts/user_posts')\n       end\n     end\n-\n-    describe 'GET assign_vote ' do\n-      let!(:post1) { create :post }\n-      let!(:post2) { create :post }\n-\n-      before do\n-        fetch_activity_type('post.like')\n-        fetch_activity_type('post.dislike')\n-        post1.liked_by user\n-        post2.downvote_from user\n-      end\n-\n-      it 'like post' do\n-        expect do\n-          get :assign_vote, vote_type: 'like', id: post_one.id, format: :json\n-        end.to change(post_one.get_likes, :count).by(1)\n-      end\n-\n-      it 'does not increase like-count if already liked' do\n-        expect do\n-          get :assign_vote, vote_type: 'like', id: post1.id, format: :json\n-        end.to_not change(post1.get_likes, :count)\n-      end\n-\n-      it 'dislike post' do\n-        expect do\n-          get :assign_vote, vote_type: 'dislike', id: post_one.id, format: :json\n-        end.to change(post_one.get_dislikes, :count).by(1)\n-      end\n-\n-      it 'does not increase dislike-count if already disliked' do\n-        expect do\n-          get :assign_vote, vote_type: 'dislike', id: post2.id, format: :json\n-        end.to_not change(post2.get_dislikes, :count)\n-      end\n-\n-      it 'changes the dislike count after upvote ' do\n-        expect do\n-          get :assign_vote, vote_type: 'like', id: post2.id, format: :json\n-        end.to change(post2.get_dislikes, :count).by(-1)\n-        expect(post2.get_likes.size).to eq(1)\n-      end\n-\n-      it 'changes the like-count after downvote ' do\n-        expect do\n-          get :assign_vote, vote_type: 'dislike', id: post1.id, format: :json\n-        end.to change(post1.get_likes, :count).by(-1)\n-        expect(post1.get_dislikes.size).to eq(1)\n-      end\n-    end","path":"spec/controllers/posts_controller_spec.rb","position":73,"original_position":73,"commit_id":"436b373f6adeafb1f0e4ea53a0100bfe22dfce67","original_commit_id":"436b373f6adeafb1f0e4ea53a0100bfe22dfce67","user":{"login":"shivanibhanwal","id":1167588,"avatar_url":"https://avatars.githubusercontent.com/u/1167588?v=3","gravatar_id":"","url":"https://api.github.com/users/shivanibhanwal","html_url":"https://github.com/shivanibhanwal","followers_url":"https://api.github.com/users/shivanibhanwal/followers","following_url":"https://api.github.com/users/shivanibhanwal/following{/other_user}","gists_url":"https://api.github.com/users/shivanibhanwal/gists{/gist_id}","starred_url":"https://api.github.com/users/shivanibhanwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shivanibhanwal/subscriptions","organizations_url":"https://api.github.com/users/shivanibhanwal/orgs","repos_url":"https://api.github.com/users/shivanibhanwal/repos","events_url":"https://api.github.com/users/shivanibhanwal/events{/privacy}","received_events_url":"https://api.github.com/users/shivanibhanwal/received_events","type":"User","site_admin":false},"body":"Agree we can add spec for response check only.\n\n> On 10-May-2016, at 14:26, Rohan Pujari <notifications@github.com> wrote:\n> \n> In spec/controllers/posts_controller_spec.rb <https://github.com/rohandaxini/knowbuddy/pull/72#discussion_r62633707>:\n> \n> > -      end\n> > -\n> > -      it 'changes the dislike count after upvote ' do\n> > -        expect do\n> > -          get :assign_vote, vote_type: 'like', id: post2.id, format: :json\n> > -        end.to change(post2.get_dislikes, :count).by(-1)\n> > -        expect(post2.get_likes.size).to eq(1)\n> > -      end\n> > -\n> > -      it 'changes the like-count after downvote ' do\n> > -        expect do\n> > -          get :assign_vote, vote_type: 'dislike', id: post1.id, format: :json\n> > -        end.to change(post1.get_likes, :count).by(-1)\n> > -        expect(post1.get_dislikes.size).to eq(1)\n> > -      end\n> > -    end\n> @shivanibhanwal <https://github.com/shivanibhanwal>, I think we should not add controller specs. If we are adding controller spec then we can add it just too check if response is successful. toogle_vote action doesn't contain any logic. All logic is shifted to model and we have model specs to verify the logic.\n> \n> cc: @Manisha-Darade <https://github.com/Manisha-Darade>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly or view it on GitHub <https://github.com/rohandaxini/knowbuddy/pull/72/files/436b373f6adeafb1f0e4ea53a0100bfe22dfce67#r62633707>\n\n","created_at":"2016-05-10T09:56:56Z","updated_at":"2016-05-10T09:56:56Z","html_url":"https://github.com/rohandaxini/knowbuddy/pull/72#discussion_r62643043","pull_request_url":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/comments/62643043"},"html":{"href":"https://github.com/rohandaxini/knowbuddy/pull/72#discussion_r62643043"},"pull_request":{"href":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/72","id":68545551,"html_url":"https://github.com/rohandaxini/knowbuddy/pull/72","diff_url":"https://github.com/rohandaxini/knowbuddy/pull/72.diff","patch_url":"https://github.com/rohandaxini/knowbuddy/pull/72.patch","issue_url":"https://api.github.com/repos/rohandaxini/knowbuddy/issues/72","number":72,"state":"open","locked":false,"title":"Remove post dislike feature","user":{"login":"Manisha-Darade","id":18572249,"avatar_url":"https://avatars.githubusercontent.com/u/18572249?v=3","gravatar_id":"","url":"https://api.github.com/users/Manisha-Darade","html_url":"https://github.com/Manisha-Darade","followers_url":"https://api.github.com/users/Manisha-Darade/followers","following_url":"https://api.github.com/users/Manisha-Darade/following{/other_user}","gists_url":"https://api.github.com/users/Manisha-Darade/gists{/gist_id}","starred_url":"https://api.github.com/users/Manisha-Darade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manisha-Darade/subscriptions","organizations_url":"https://api.github.com/users/Manisha-Darade/orgs","repos_url":"https://api.github.com/users/Manisha-Darade/repos","events_url":"https://api.github.com/users/Manisha-Darade/events{/privacy}","received_events_url":"https://api.github.com/users/Manisha-Darade/received_events","type":"User","site_admin":false},"body":"Hello Team,\r\n\r\nThis PR  removes post dislike feature and preventing post author from liking his/her own post.\r\nTicket link:  https://trello.com/c/zKVyMdOy\r\nPlease review and let me know if any changes are required.\r\n\r\nThanks\r\n","created_at":"2016-05-02T10:44:50Z","updated_at":"2016-05-10T09:56:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d9c2a838313f932b461ea5ab39f38467df3d017","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/72/commits","review_comments_url":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/72/comments","review_comment_url":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rohandaxini/knowbuddy/issues/72/comments","statuses_url":"https://api.github.com/repos/rohandaxini/knowbuddy/statuses/436b373f6adeafb1f0e4ea53a0100bfe22dfce67","head":{"label":"rohandaxini:remove_post_dislike_feature","ref":"remove_post_dislike_feature","sha":"436b373f6adeafb1f0e4ea53a0100bfe22dfce67","user":{"login":"rohandaxini","id":970712,"avatar_url":"https://avatars.githubusercontent.com/u/970712?v=3","gravatar_id":"","url":"https://api.github.com/users/rohandaxini","html_url":"https://github.com/rohandaxini","followers_url":"https://api.github.com/users/rohandaxini/followers","following_url":"https://api.github.com/users/rohandaxini/following{/other_user}","gists_url":"https://api.github.com/users/rohandaxini/gists{/gist_id}","starred_url":"https://api.github.com/users/rohandaxini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohandaxini/subscriptions","organizations_url":"https://api.github.com/users/rohandaxini/orgs","repos_url":"https://api.github.com/users/rohandaxini/repos","events_url":"https://api.github.com/users/rohandaxini/events{/privacy}","received_events_url":"https://api.github.com/users/rohandaxini/received_events","type":"User","site_admin":false},"repo":{"id":3616675,"name":"knowbuddy","full_name":"rohandaxini/knowbuddy","owner":{"login":"rohandaxini","id":970712,"avatar_url":"https://avatars.githubusercontent.com/u/970712?v=3","gravatar_id":"","url":"https://api.github.com/users/rohandaxini","html_url":"https://github.com/rohandaxini","followers_url":"https://api.github.com/users/rohandaxini/followers","following_url":"https://api.github.com/users/rohandaxini/following{/other_user}","gists_url":"https://api.github.com/users/rohandaxini/gists{/gist_id}","starred_url":"https://api.github.com/users/rohandaxini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohandaxini/subscriptions","organizations_url":"https://api.github.com/users/rohandaxini/orgs","repos_url":"https://api.github.com/users/rohandaxini/repos","events_url":"https://api.github.com/users/rohandaxini/events{/privacy}","received_events_url":"https://api.github.com/users/rohandaxini/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rohandaxini/knowbuddy","description":"Knowledge Buddy","fork":false,"url":"https://api.github.com/repos/rohandaxini/knowbuddy","forks_url":"https://api.github.com/repos/rohandaxini/knowbuddy/forks","keys_url":"https://api.github.com/repos/rohandaxini/knowbuddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rohandaxini/knowbuddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rohandaxini/knowbuddy/teams","hooks_url":"https://api.github.com/repos/rohandaxini/knowbuddy/hooks","issue_events_url":"https://api.github.com/repos/rohandaxini/knowbuddy/issues/events{/number}","events_url":"https://api.github.com/repos/rohandaxini/knowbuddy/events","assignees_url":"https://api.github.com/repos/rohandaxini/knowbuddy/assignees{/user}","branches_url":"https://api.github.com/repos/rohandaxini/knowbuddy/branches{/branch}","tags_url":"https://api.github.com/repos/rohandaxini/knowbuddy/tags","blobs_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rohandaxini/knowbuddy/statuses/{sha}","languages_url":"https://api.github.com/repos/rohandaxini/knowbuddy/languages","stargazers_url":"https://api.github.com/repos/rohandaxini/knowbuddy/stargazers","contributors_url":"https://api.github.com/repos/rohandaxini/knowbuddy/contributors","subscribers_url":"https://api.github.com/repos/rohandaxini/knowbuddy/subscribers","subscription_url":"https://api.github.com/repos/rohandaxini/knowbuddy/subscription","commits_url":"https://api.github.com/repos/rohandaxini/knowbuddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/rohandaxini/knowbuddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/rohandaxini/knowbuddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/rohandaxini/knowbuddy/contents/{+path}","compare_url":"https://api.github.com/repos/rohandaxini/knowbuddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rohandaxini/knowbuddy/merges","archive_url":"https://api.github.com/repos/rohandaxini/knowbuddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rohandaxini/knowbuddy/downloads","issues_url":"https://api.github.com/repos/rohandaxini/knowbuddy/issues{/number}","pulls_url":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls{/number}","milestones_url":"https://api.github.com/repos/rohandaxini/knowbuddy/milestones{/number}","notifications_url":"https://api.github.com/repos/rohandaxini/knowbuddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rohandaxini/knowbuddy/labels{/name}","releases_url":"https://api.github.com/repos/rohandaxini/knowbuddy/releases{/id}","deployments_url":"https://api.github.com/repos/rohandaxini/knowbuddy/deployments","created_at":"2012-03-04T07:19:54Z","updated_at":"2016-05-05T03:06:03Z","pushed_at":"2016-05-10T08:22:08Z","git_url":"git://github.com/rohandaxini/knowbuddy.git","ssh_url":"git@github.com:rohandaxini/knowbuddy.git","clone_url":"https://github.com/rohandaxini/knowbuddy.git","svn_url":"https://github.com/rohandaxini/knowbuddy","homepage":"","size":2149,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":7,"default_branch":"master"}},"base":{"label":"rohandaxini:master","ref":"master","sha":"9e8d5d412aa8434103740aace76ec05d02750f65","user":{"login":"rohandaxini","id":970712,"avatar_url":"https://avatars.githubusercontent.com/u/970712?v=3","gravatar_id":"","url":"https://api.github.com/users/rohandaxini","html_url":"https://github.com/rohandaxini","followers_url":"https://api.github.com/users/rohandaxini/followers","following_url":"https://api.github.com/users/rohandaxini/following{/other_user}","gists_url":"https://api.github.com/users/rohandaxini/gists{/gist_id}","starred_url":"https://api.github.com/users/rohandaxini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohandaxini/subscriptions","organizations_url":"https://api.github.com/users/rohandaxini/orgs","repos_url":"https://api.github.com/users/rohandaxini/repos","events_url":"https://api.github.com/users/rohandaxini/events{/privacy}","received_events_url":"https://api.github.com/users/rohandaxini/received_events","type":"User","site_admin":false},"repo":{"id":3616675,"name":"knowbuddy","full_name":"rohandaxini/knowbuddy","owner":{"login":"rohandaxini","id":970712,"avatar_url":"https://avatars.githubusercontent.com/u/970712?v=3","gravatar_id":"","url":"https://api.github.com/users/rohandaxini","html_url":"https://github.com/rohandaxini","followers_url":"https://api.github.com/users/rohandaxini/followers","following_url":"https://api.github.com/users/rohandaxini/following{/other_user}","gists_url":"https://api.github.com/users/rohandaxini/gists{/gist_id}","starred_url":"https://api.github.com/users/rohandaxini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohandaxini/subscriptions","organizations_url":"https://api.github.com/users/rohandaxini/orgs","repos_url":"https://api.github.com/users/rohandaxini/repos","events_url":"https://api.github.com/users/rohandaxini/events{/privacy}","received_events_url":"https://api.github.com/users/rohandaxini/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rohandaxini/knowbuddy","description":"Knowledge Buddy","fork":false,"url":"https://api.github.com/repos/rohandaxini/knowbuddy","forks_url":"https://api.github.com/repos/rohandaxini/knowbuddy/forks","keys_url":"https://api.github.com/repos/rohandaxini/knowbuddy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rohandaxini/knowbuddy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rohandaxini/knowbuddy/teams","hooks_url":"https://api.github.com/repos/rohandaxini/knowbuddy/hooks","issue_events_url":"https://api.github.com/repos/rohandaxini/knowbuddy/issues/events{/number}","events_url":"https://api.github.com/repos/rohandaxini/knowbuddy/events","assignees_url":"https://api.github.com/repos/rohandaxini/knowbuddy/assignees{/user}","branches_url":"https://api.github.com/repos/rohandaxini/knowbuddy/branches{/branch}","tags_url":"https://api.github.com/repos/rohandaxini/knowbuddy/tags","blobs_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/refs{/sha}","trees_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rohandaxini/knowbuddy/statuses/{sha}","languages_url":"https://api.github.com/repos/rohandaxini/knowbuddy/languages","stargazers_url":"https://api.github.com/repos/rohandaxini/knowbuddy/stargazers","contributors_url":"https://api.github.com/repos/rohandaxini/knowbuddy/contributors","subscribers_url":"https://api.github.com/repos/rohandaxini/knowbuddy/subscribers","subscription_url":"https://api.github.com/repos/rohandaxini/knowbuddy/subscription","commits_url":"https://api.github.com/repos/rohandaxini/knowbuddy/commits{/sha}","git_commits_url":"https://api.github.com/repos/rohandaxini/knowbuddy/git/commits{/sha}","comments_url":"https://api.github.com/repos/rohandaxini/knowbuddy/comments{/number}","issue_comment_url":"https://api.github.com/repos/rohandaxini/knowbuddy/issues/comments{/number}","contents_url":"https://api.github.com/repos/rohandaxini/knowbuddy/contents/{+path}","compare_url":"https://api.github.com/repos/rohandaxini/knowbuddy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rohandaxini/knowbuddy/merges","archive_url":"https://api.github.com/repos/rohandaxini/knowbuddy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rohandaxini/knowbuddy/downloads","issues_url":"https://api.github.com/repos/rohandaxini/knowbuddy/issues{/number}","pulls_url":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls{/number}","milestones_url":"https://api.github.com/repos/rohandaxini/knowbuddy/milestones{/number}","notifications_url":"https://api.github.com/repos/rohandaxini/knowbuddy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rohandaxini/knowbuddy/labels{/name}","releases_url":"https://api.github.com/repos/rohandaxini/knowbuddy/releases{/id}","deployments_url":"https://api.github.com/repos/rohandaxini/knowbuddy/deployments","created_at":"2012-03-04T07:19:54Z","updated_at":"2016-05-05T03:06:03Z","pushed_at":"2016-05-10T08:22:08Z","git_url":"git://github.com/rohandaxini/knowbuddy.git","ssh_url":"git@github.com:rohandaxini/knowbuddy.git","clone_url":"https://github.com/rohandaxini/knowbuddy.git","svn_url":"https://github.com/rohandaxini/knowbuddy","homepage":"","size":2149,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/72"},"html":{"href":"https://github.com/rohandaxini/knowbuddy/pull/72"},"issue":{"href":"https://api.github.com/repos/rohandaxini/knowbuddy/issues/72"},"comments":{"href":"https://api.github.com/repos/rohandaxini/knowbuddy/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rohandaxini/knowbuddy/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/rohandaxini/knowbuddy/statuses/436b373f6adeafb1f0e4ea53a0100bfe22dfce67"}}}}