{"action":"created","comment":{"url":"https://api.github.com/repos/kgabinete08/myflix/pulls/comments/43336850","id":43336850,"diff_hunk":"@@ -0,0 +1,80 @@\n+require 'spec_helper'\n+\n+describe Admin::VideosController do\n+  describe \"GET new\" do\n+    it_behaves_like \"requires sign in\" do\n+      let(:action) { get :new }\n+    end\n+\n+    it_behaves_like \"requires admin\" do\n+      let(:action) { get :new }\n+    end\n+\n+    it \"redirects non admin users to the home path\" do\n+      set_current_user\n+      get :new\n+      expect(response).to redirect_to home_path\n+    end\n+\n+    it \"sets flash message for non admin users\" do\n+      set_current_user\n+      get :new\n+      expect(flash[:danger]).to be_present\n+    end\n+  end\n+\n+  describe \"POST create\" do\n+    it_behaves_like \"requires sign in\" do\n+      let(:action) { post :create }\n+    end\n+\n+    it_behaves_like \"requires admin\" do\n+      let(:action) { post :create }\n+    end\n+\n+    context \"with valid input\" do\n+      before { set_current_admin }\n+      let(:category) { Fabricate(:category) }\n+\n+      it \"redirects to the add new video page\" do\n+        post :create, video: { title: \"Ghostbusters\", description: \"Who you gonna call?\", category_id: category.id }","path":"spec/controllers/admin/videos_controller_spec.rb","position":40,"original_position":40,"commit_id":"3f87374be8122c2bff21bcb615c663476a5e2d67","original_commit_id":"3f87374be8122c2bff21bcb615c663476a5e2d67","user":{"login":"brandoncc","id":543973,"avatar_url":"https://avatars.githubusercontent.com/u/543973?v=3","gravatar_id":"","url":"https://api.github.com/users/brandoncc","html_url":"https://github.com/brandoncc","followers_url":"https://api.github.com/users/brandoncc/followers","following_url":"https://api.github.com/users/brandoncc/following{/other_user}","gists_url":"https://api.github.com/users/brandoncc/gists{/gist_id}","starred_url":"https://api.github.com/users/brandoncc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandoncc/subscriptions","organizations_url":"https://api.github.com/users/brandoncc/orgs","repos_url":"https://api.github.com/users/brandoncc/repos","events_url":"https://api.github.com/users/brandoncc/events{/privacy}","received_events_url":"https://api.github.com/users/brandoncc/received_events","type":"User","site_admin":false},"body":"You can also do `category: category`.","created_at":"2015-10-29T00:29:32Z","updated_at":"2015-10-29T00:29:32Z","html_url":"https://github.com/kgabinete08/myflix/pull/7#discussion_r43336850","pull_request_url":"https://api.github.com/repos/kgabinete08/myflix/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/kgabinete08/myflix/pulls/comments/43336850"},"html":{"href":"https://github.com/kgabinete08/myflix/pull/7#discussion_r43336850"},"pull_request":{"href":"https://api.github.com/repos/kgabinete08/myflix/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/kgabinete08/myflix/pulls/7","id":49066196,"html_url":"https://github.com/kgabinete08/myflix/pull/7","diff_url":"https://github.com/kgabinete08/myflix/pull/7.diff","patch_url":"https://github.com/kgabinete08/myflix/pull/7.patch","issue_url":"https://api.github.com/repos/kgabinete08/myflix/issues/7","number":7,"state":"open","locked":false,"title":"Week 6 mod 1","user":{"login":"kgabinete08","id":10375514,"avatar_url":"https://avatars.githubusercontent.com/u/10375514?v=3","gravatar_id":"","url":"https://api.github.com/users/kgabinete08","html_url":"https://github.com/kgabinete08","followers_url":"https://api.github.com/users/kgabinete08/followers","following_url":"https://api.github.com/users/kgabinete08/following{/other_user}","gists_url":"https://api.github.com/users/kgabinete08/gists{/gist_id}","starred_url":"https://api.github.com/users/kgabinete08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgabinete08/subscriptions","organizations_url":"https://api.github.com/users/kgabinete08/orgs","repos_url":"https://api.github.com/users/kgabinete08/repos","events_url":"https://api.github.com/users/kgabinete08/events{/privacy}","received_events_url":"https://api.github.com/users/kgabinete08/received_events","type":"User","site_admin":false},"body":"- Admin can add new video\r\n- Figaro gem for managing env variables\r\n","created_at":"2015-10-28T21:00:03Z","updated_at":"2015-10-29T00:29:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e3a79a7ad08cd1226d77a0740152ec1a97880ce1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kgabinete08/myflix/pulls/7/commits","review_comments_url":"https://api.github.com/repos/kgabinete08/myflix/pulls/7/comments","review_comment_url":"https://api.github.com/repos/kgabinete08/myflix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kgabinete08/myflix/issues/7/comments","statuses_url":"https://api.github.com/repos/kgabinete08/myflix/statuses/3f87374be8122c2bff21bcb615c663476a5e2d67","head":{"label":"kgabinete08:week-6-mod-1","ref":"week-6-mod-1","sha":"3f87374be8122c2bff21bcb615c663476a5e2d67","user":{"login":"kgabinete08","id":10375514,"avatar_url":"https://avatars.githubusercontent.com/u/10375514?v=3","gravatar_id":"","url":"https://api.github.com/users/kgabinete08","html_url":"https://github.com/kgabinete08","followers_url":"https://api.github.com/users/kgabinete08/followers","following_url":"https://api.github.com/users/kgabinete08/following{/other_user}","gists_url":"https://api.github.com/users/kgabinete08/gists{/gist_id}","starred_url":"https://api.github.com/users/kgabinete08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgabinete08/subscriptions","organizations_url":"https://api.github.com/users/kgabinete08/orgs","repos_url":"https://api.github.com/users/kgabinete08/repos","events_url":"https://api.github.com/users/kgabinete08/events{/privacy}","received_events_url":"https://api.github.com/users/kgabinete08/received_events","type":"User","site_admin":false},"repo":{"id":34186651,"name":"myflix","full_name":"kgabinete08/myflix","owner":{"login":"kgabinete08","id":10375514,"avatar_url":"https://avatars.githubusercontent.com/u/10375514?v=3","gravatar_id":"","url":"https://api.github.com/users/kgabinete08","html_url":"https://github.com/kgabinete08","followers_url":"https://api.github.com/users/kgabinete08/followers","following_url":"https://api.github.com/users/kgabinete08/following{/other_user}","gists_url":"https://api.github.com/users/kgabinete08/gists{/gist_id}","starred_url":"https://api.github.com/users/kgabinete08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgabinete08/subscriptions","organizations_url":"https://api.github.com/users/kgabinete08/orgs","repos_url":"https://api.github.com/users/kgabinete08/repos","events_url":"https://api.github.com/users/kgabinete08/events{/privacy}","received_events_url":"https://api.github.com/users/kgabinete08/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kgabinete08/myflix","description":"","fork":false,"url":"https://api.github.com/repos/kgabinete08/myflix","forks_url":"https://api.github.com/repos/kgabinete08/myflix/forks","keys_url":"https://api.github.com/repos/kgabinete08/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kgabinete08/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kgabinete08/myflix/teams","hooks_url":"https://api.github.com/repos/kgabinete08/myflix/hooks","issue_events_url":"https://api.github.com/repos/kgabinete08/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/kgabinete08/myflix/events","assignees_url":"https://api.github.com/repos/kgabinete08/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/kgabinete08/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/kgabinete08/myflix/tags","blobs_url":"https://api.github.com/repos/kgabinete08/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kgabinete08/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kgabinete08/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/kgabinete08/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kgabinete08/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/kgabinete08/myflix/languages","stargazers_url":"https://api.github.com/repos/kgabinete08/myflix/stargazers","contributors_url":"https://api.github.com/repos/kgabinete08/myflix/contributors","subscribers_url":"https://api.github.com/repos/kgabinete08/myflix/subscribers","subscription_url":"https://api.github.com/repos/kgabinete08/myflix/subscription","commits_url":"https://api.github.com/repos/kgabinete08/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/kgabinete08/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/kgabinete08/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/kgabinete08/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/kgabinete08/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/kgabinete08/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kgabinete08/myflix/merges","archive_url":"https://api.github.com/repos/kgabinete08/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kgabinete08/myflix/downloads","issues_url":"https://api.github.com/repos/kgabinete08/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/kgabinete08/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/kgabinete08/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/kgabinete08/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kgabinete08/myflix/labels{/name}","releases_url":"https://api.github.com/repos/kgabinete08/myflix/releases{/id}","created_at":"2015-04-18T23:23:06Z","updated_at":"2015-05-06T02:17:14Z","pushed_at":"2015-10-28T21:00:04Z","git_url":"git://github.com/kgabinete08/myflix.git","ssh_url":"git@github.com:kgabinete08/myflix.git","clone_url":"https://github.com/kgabinete08/myflix.git","svn_url":"https://github.com/kgabinete08/myflix","homepage":null,"size":576,"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":"kgabinete08:staging","ref":"staging","sha":"5f912c8b98856b9e65e255a60afd46eb11aece7d","user":{"login":"kgabinete08","id":10375514,"avatar_url":"https://avatars.githubusercontent.com/u/10375514?v=3","gravatar_id":"","url":"https://api.github.com/users/kgabinete08","html_url":"https://github.com/kgabinete08","followers_url":"https://api.github.com/users/kgabinete08/followers","following_url":"https://api.github.com/users/kgabinete08/following{/other_user}","gists_url":"https://api.github.com/users/kgabinete08/gists{/gist_id}","starred_url":"https://api.github.com/users/kgabinete08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgabinete08/subscriptions","organizations_url":"https://api.github.com/users/kgabinete08/orgs","repos_url":"https://api.github.com/users/kgabinete08/repos","events_url":"https://api.github.com/users/kgabinete08/events{/privacy}","received_events_url":"https://api.github.com/users/kgabinete08/received_events","type":"User","site_admin":false},"repo":{"id":34186651,"name":"myflix","full_name":"kgabinete08/myflix","owner":{"login":"kgabinete08","id":10375514,"avatar_url":"https://avatars.githubusercontent.com/u/10375514?v=3","gravatar_id":"","url":"https://api.github.com/users/kgabinete08","html_url":"https://github.com/kgabinete08","followers_url":"https://api.github.com/users/kgabinete08/followers","following_url":"https://api.github.com/users/kgabinete08/following{/other_user}","gists_url":"https://api.github.com/users/kgabinete08/gists{/gist_id}","starred_url":"https://api.github.com/users/kgabinete08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgabinete08/subscriptions","organizations_url":"https://api.github.com/users/kgabinete08/orgs","repos_url":"https://api.github.com/users/kgabinete08/repos","events_url":"https://api.github.com/users/kgabinete08/events{/privacy}","received_events_url":"https://api.github.com/users/kgabinete08/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kgabinete08/myflix","description":"","fork":false,"url":"https://api.github.com/repos/kgabinete08/myflix","forks_url":"https://api.github.com/repos/kgabinete08/myflix/forks","keys_url":"https://api.github.com/repos/kgabinete08/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kgabinete08/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kgabinete08/myflix/teams","hooks_url":"https://api.github.com/repos/kgabinete08/myflix/hooks","issue_events_url":"https://api.github.com/repos/kgabinete08/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/kgabinete08/myflix/events","assignees_url":"https://api.github.com/repos/kgabinete08/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/kgabinete08/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/kgabinete08/myflix/tags","blobs_url":"https://api.github.com/repos/kgabinete08/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kgabinete08/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kgabinete08/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/kgabinete08/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kgabinete08/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/kgabinete08/myflix/languages","stargazers_url":"https://api.github.com/repos/kgabinete08/myflix/stargazers","contributors_url":"https://api.github.com/repos/kgabinete08/myflix/contributors","subscribers_url":"https://api.github.com/repos/kgabinete08/myflix/subscribers","subscription_url":"https://api.github.com/repos/kgabinete08/myflix/subscription","commits_url":"https://api.github.com/repos/kgabinete08/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/kgabinete08/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/kgabinete08/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/kgabinete08/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/kgabinete08/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/kgabinete08/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kgabinete08/myflix/merges","archive_url":"https://api.github.com/repos/kgabinete08/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kgabinete08/myflix/downloads","issues_url":"https://api.github.com/repos/kgabinete08/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/kgabinete08/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/kgabinete08/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/kgabinete08/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kgabinete08/myflix/labels{/name}","releases_url":"https://api.github.com/repos/kgabinete08/myflix/releases{/id}","created_at":"2015-04-18T23:23:06Z","updated_at":"2015-05-06T02:17:14Z","pushed_at":"2015-10-28T21:00:04Z","git_url":"git://github.com/kgabinete08/myflix.git","ssh_url":"git@github.com:kgabinete08/myflix.git","clone_url":"https://github.com/kgabinete08/myflix.git","svn_url":"https://github.com/kgabinete08/myflix","homepage":null,"size":576,"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/kgabinete08/myflix/pulls/7"},"html":{"href":"https://github.com/kgabinete08/myflix/pull/7"},"issue":{"href":"https://api.github.com/repos/kgabinete08/myflix/issues/7"},"comments":{"href":"https://api.github.com/repos/kgabinete08/myflix/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/kgabinete08/myflix/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/kgabinete08/myflix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kgabinete08/myflix/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/kgabinete08/myflix/statuses/3f87374be8122c2bff21bcb615c663476a5e2d67"}}}}