{"action":"created","comment":{"url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/comments/26988211","id":26988211,"diff_hunk":"@@ -89,23 +89,117 @@\n     it 'removes the queue item' do\n       user = Fabricate(:user)\n       session[:user_id] = user.id\n-      queue_item = Fabricate(:queue_item, user: user)\n+      queue_item = Fabricate(:queue_item, user: user, position: 1)\n       delete :destroy, id: queue_item.id \n       expect(QueueItem.count).to eq(0)\n     end\n \n-    it 'does not delete queueitem if not associated with the current_user' do\n+    it 'normalizes the queue items after delete' do\n+      user = Fabricate(:user)\n+      session[:user_id] = user.id\n+      queue_item1 = Fabricate(:queue_item, user: user, position: 1)\n+      queue_item2 = Fabricate(:queue_item, user: user, position: 2)\n+      delete :destroy, id: queue_item1.id \n+      expect(queue_item2.reload.position).to eq(1)\n+     end\n+\n+    it 'does not delete queue_item if not associated with the current_user' do\n       john_doe = Fabricate(:user)\n       mary_jane = Fabricate(:user)\n       session[:user_id] = john_doe.id\n-      queue_item = Fabricate(:queue_item, user: mary_jane)\n+      queue_item = Fabricate(:queue_item, user: mary_jane, position: 1)\n       delete :destroy, id:  queue_item.id\n       expect(QueueItem.count).to eq(1)\n     end\n-    \n+\n     it 'redirects to the sign_in_path for unathenticated users' do\n       delete :destroy, id: 1\n       expect(response).to redirect_to sign_in_path\n     end\n   end\n+\n+  describe 'POST #update_queue' do\n+    context 'authenticated user' do\n+      it 'redirects to my_queue page' do\n+        user = Fabricate(:user)\n+        session[:user_id] = user.id\n+        video = Fabricate(:video)\n+        queue_item1 = Fabricate(:queue_item, user: user, video: video, position: 1)\n+        queue_item2 = Fabricate(:queue_item, user: user, video: video, position: 2)\n+        post :update_queue, queue_items: [{ id: queue_item1.id, position: 2 }, { id: queue_item2.id, position: 1}]\n+        expect(response).to redirect_to my_queue_path\n+      end","path":"spec/controllers/queue_items_controller_spec.rb","position":89,"original_position":89,"commit_id":"0d00b6ba59cb0c0fe5d91dc7c7f1414d46f554e3","original_commit_id":"0d00b6ba59cb0c0fe5d91dc7c7f1414d46f554e3","user":{"login":"tomtomecek","id":7385469,"avatar_url":"https://avatars.githubusercontent.com/u/7385469?v=3","gravatar_id":"","url":"https://api.github.com/users/tomtomecek","html_url":"https://github.com/tomtomecek","followers_url":"https://api.github.com/users/tomtomecek/followers","following_url":"https://api.github.com/users/tomtomecek/following{/other_user}","gists_url":"https://api.github.com/users/tomtomecek/gists{/gist_id}","starred_url":"https://api.github.com/users/tomtomecek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomtomecek/subscriptions","organizations_url":"https://api.github.com/users/tomtomecek/orgs","repos_url":"https://api.github.com/users/tomtomecek/repos","events_url":"https://api.github.com/users/tomtomecek/events{/privacy}","received_events_url":"https://api.github.com/users/tomtomecek/received_events","type":"User","site_admin":false},"body":"There should be an empty line between specs - better readability.","created_at":"2015-03-23T22:41:31Z","updated_at":"2015-03-23T22:41:31Z","html_url":"https://github.com/madhatter84gn/gotealeaf-myflix/pull/4#discussion_r26988211","pull_request_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/comments/26988211"},"html":{"href":"https://github.com/madhatter84gn/gotealeaf-myflix/pull/4#discussion_r26988211"},"pull_request":{"href":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/4","id":31780637,"html_url":"https://github.com/madhatter84gn/gotealeaf-myflix/pull/4","diff_url":"https://github.com/madhatter84gn/gotealeaf-myflix/pull/4.diff","patch_url":"https://github.com/madhatter84gn/gotealeaf-myflix/pull/4.patch","issue_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues/4","number":4,"state":"open","locked":false,"title":"Week3","user":{"login":"madhatter84gn","id":377187,"avatar_url":"https://avatars.githubusercontent.com/u/377187?v=3","gravatar_id":"","url":"https://api.github.com/users/madhatter84gn","html_url":"https://github.com/madhatter84gn","followers_url":"https://api.github.com/users/madhatter84gn/followers","following_url":"https://api.github.com/users/madhatter84gn/following{/other_user}","gists_url":"https://api.github.com/users/madhatter84gn/gists{/gist_id}","starred_url":"https://api.github.com/users/madhatter84gn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madhatter84gn/subscriptions","organizations_url":"https://api.github.com/users/madhatter84gn/orgs","repos_url":"https://api.github.com/users/madhatter84gn/repos","events_url":"https://api.github.com/users/madhatter84gn/events{/privacy}","received_events_url":"https://api.github.com/users/madhatter84gn/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-23T22:28:44Z","updated_at":"2015-03-23T22:41:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3724fd1006bc8cd8a43264f1d5f8f8ccbe3fa237","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/4/commits","review_comments_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/4/comments","review_comment_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues/4/comments","statuses_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/statuses/0d00b6ba59cb0c0fe5d91dc7c7f1414d46f554e3","head":{"label":"madhatter84gn:Week3","ref":"Week3","sha":"0d00b6ba59cb0c0fe5d91dc7c7f1414d46f554e3","user":{"login":"madhatter84gn","id":377187,"avatar_url":"https://avatars.githubusercontent.com/u/377187?v=3","gravatar_id":"","url":"https://api.github.com/users/madhatter84gn","html_url":"https://github.com/madhatter84gn","followers_url":"https://api.github.com/users/madhatter84gn/followers","following_url":"https://api.github.com/users/madhatter84gn/following{/other_user}","gists_url":"https://api.github.com/users/madhatter84gn/gists{/gist_id}","starred_url":"https://api.github.com/users/madhatter84gn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madhatter84gn/subscriptions","organizations_url":"https://api.github.com/users/madhatter84gn/orgs","repos_url":"https://api.github.com/users/madhatter84gn/repos","events_url":"https://api.github.com/users/madhatter84gn/events{/privacy}","received_events_url":"https://api.github.com/users/madhatter84gn/received_events","type":"User","site_admin":false},"repo":{"id":31506644,"name":"gotealeaf-myflix","full_name":"madhatter84gn/gotealeaf-myflix","owner":{"login":"madhatter84gn","id":377187,"avatar_url":"https://avatars.githubusercontent.com/u/377187?v=3","gravatar_id":"","url":"https://api.github.com/users/madhatter84gn","html_url":"https://github.com/madhatter84gn","followers_url":"https://api.github.com/users/madhatter84gn/followers","following_url":"https://api.github.com/users/madhatter84gn/following{/other_user}","gists_url":"https://api.github.com/users/madhatter84gn/gists{/gist_id}","starred_url":"https://api.github.com/users/madhatter84gn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madhatter84gn/subscriptions","organizations_url":"https://api.github.com/users/madhatter84gn/orgs","repos_url":"https://api.github.com/users/madhatter84gn/repos","events_url":"https://api.github.com/users/madhatter84gn/events{/privacy}","received_events_url":"https://api.github.com/users/madhatter84gn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/madhatter84gn/gotealeaf-myflix","description":"","fork":false,"url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix","forks_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/forks","keys_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/teams","hooks_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/hooks","issue_events_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues/events{/number}","events_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/events","assignees_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/assignees{/user}","branches_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/branches{/branch}","tags_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/tags","blobs_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/languages","stargazers_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/stargazers","contributors_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/contributors","subscribers_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/subscribers","subscription_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/subscription","commits_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/contents/{+path}","compare_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/merges","archive_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/downloads","issues_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues{/number}","pulls_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/labels{/name}","releases_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/releases{/id}","created_at":"2015-03-01T18:50:44Z","updated_at":"2015-03-19T00:59:20Z","pushed_at":"2015-03-23T22:28:44Z","git_url":"git://github.com/madhatter84gn/gotealeaf-myflix.git","ssh_url":"git@github.com:madhatter84gn/gotealeaf-myflix.git","clone_url":"https://github.com/madhatter84gn/gotealeaf-myflix.git","svn_url":"https://github.com/madhatter84gn/gotealeaf-myflix","homepage":null,"size":448,"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":"madhatter84gn:master","ref":"master","sha":"440cedddc3f67a3972738ef955146be50b22babb","user":{"login":"madhatter84gn","id":377187,"avatar_url":"https://avatars.githubusercontent.com/u/377187?v=3","gravatar_id":"","url":"https://api.github.com/users/madhatter84gn","html_url":"https://github.com/madhatter84gn","followers_url":"https://api.github.com/users/madhatter84gn/followers","following_url":"https://api.github.com/users/madhatter84gn/following{/other_user}","gists_url":"https://api.github.com/users/madhatter84gn/gists{/gist_id}","starred_url":"https://api.github.com/users/madhatter84gn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madhatter84gn/subscriptions","organizations_url":"https://api.github.com/users/madhatter84gn/orgs","repos_url":"https://api.github.com/users/madhatter84gn/repos","events_url":"https://api.github.com/users/madhatter84gn/events{/privacy}","received_events_url":"https://api.github.com/users/madhatter84gn/received_events","type":"User","site_admin":false},"repo":{"id":31506644,"name":"gotealeaf-myflix","full_name":"madhatter84gn/gotealeaf-myflix","owner":{"login":"madhatter84gn","id":377187,"avatar_url":"https://avatars.githubusercontent.com/u/377187?v=3","gravatar_id":"","url":"https://api.github.com/users/madhatter84gn","html_url":"https://github.com/madhatter84gn","followers_url":"https://api.github.com/users/madhatter84gn/followers","following_url":"https://api.github.com/users/madhatter84gn/following{/other_user}","gists_url":"https://api.github.com/users/madhatter84gn/gists{/gist_id}","starred_url":"https://api.github.com/users/madhatter84gn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madhatter84gn/subscriptions","organizations_url":"https://api.github.com/users/madhatter84gn/orgs","repos_url":"https://api.github.com/users/madhatter84gn/repos","events_url":"https://api.github.com/users/madhatter84gn/events{/privacy}","received_events_url":"https://api.github.com/users/madhatter84gn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/madhatter84gn/gotealeaf-myflix","description":"","fork":false,"url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix","forks_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/forks","keys_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/teams","hooks_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/hooks","issue_events_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues/events{/number}","events_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/events","assignees_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/assignees{/user}","branches_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/branches{/branch}","tags_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/tags","blobs_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/languages","stargazers_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/stargazers","contributors_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/contributors","subscribers_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/subscribers","subscription_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/subscription","commits_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/contents/{+path}","compare_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/merges","archive_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/downloads","issues_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues{/number}","pulls_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/labels{/name}","releases_url":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/releases{/id}","created_at":"2015-03-01T18:50:44Z","updated_at":"2015-03-19T00:59:20Z","pushed_at":"2015-03-23T22:28:44Z","git_url":"git://github.com/madhatter84gn/gotealeaf-myflix.git","ssh_url":"git@github.com:madhatter84gn/gotealeaf-myflix.git","clone_url":"https://github.com/madhatter84gn/gotealeaf-myflix.git","svn_url":"https://github.com/madhatter84gn/gotealeaf-myflix","homepage":null,"size":448,"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/madhatter84gn/gotealeaf-myflix/pulls/4"},"html":{"href":"https://github.com/madhatter84gn/gotealeaf-myflix/pull/4"},"issue":{"href":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues/4"},"comments":{"href":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/madhatter84gn/gotealeaf-myflix/statuses/0d00b6ba59cb0c0fe5d91dc7c7f1414d46f554e3"}}}}