{"action":"created","comment":{"url":"https://api.github.com/repos/jepetko/myflix/pulls/comments/42687806","id":42687806,"diff_hunk":"@@ -0,0 +1,137 @@\n+require 'spec_helper'\n+\n+describe Admin::VideosController do\n+\n+  include CarrierWave::Test::Matchers\n+\n+  describe 'get :new' do\n+\n+    before(:each) do\n+      admin = Fabricate(:admin)\n+      login_user admin\n+    end\n+\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 'sets @video variable' do\n+      get :new\n+      expect(assigns(:video)).to be_instance_of(Video)\n+      expect(assigns(:video)).to be_new_record\n+    end\n+\n+  end\n+\n+  describe 'post :create' do\n+\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, video: {} }\n+    end\n+\n+    context 'for valid values' do\n+\n+      let(:category) { Fabricate(:category) }\n+      before(:each) do\n+        admin = Fabricate(:admin)\n+        login_user admin\n+      end\n+\n+      context 'without images' do\n+\n+        let(:video_attrs) { Fabricate.attributes_for(:video, category_id: category.id) }\n+        before do\n+          post :create, video: video_attrs\n+        end\n+\n+        it 'creates a video' do\n+          expect(Video.all.count).to be 1\n+        end\n+\n+        it 'associates the video with the passed category' do\n+          expect(Video.last.category).to eq category\n+        end\n+\n+        it 'redirects to the new video path' do\n+          expect(response).to redirect_to new_admin_video_path\n+        end\n+\n+        it 'sets the success message' do\n+          expect(flash[:success]).to be\n+        end\n+      end\n+\n+      context 'with images' do\n+\n+        let(:video_attrs) { Fabricate.attributes_for(:video_with_covers_provided, category_id: category.id) }\n+        before do\n+          LargeCoverUploader.enable_processing = true","path":"spec/controllers/admin/videos_controller_spec.rb","position":76,"original_position":76,"commit_id":"aae865a0350a8bf530753d4c1ff917a65898e389","original_commit_id":"aae865a0350a8bf530753d4c1ff917a65898e389","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":"Why do you disable processing in your initializer but then enable it here manually?","created_at":"2015-10-21T21:52:37Z","updated_at":"2015-10-21T21:52:37Z","html_url":"https://github.com/jepetko/myflix/pull/12#discussion_r42687806","pull_request_url":"https://api.github.com/repos/jepetko/myflix/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/comments/42687806"},"html":{"href":"https://github.com/jepetko/myflix/pull/12#discussion_r42687806"},"pull_request":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/jepetko/myflix/pulls/12","id":48362889,"html_url":"https://github.com/jepetko/myflix/pull/12","diff_url":"https://github.com/jepetko/myflix/pull/12.diff","patch_url":"https://github.com/jepetko/myflix/pull/12.patch","issue_url":"https://api.github.com/repos/jepetko/myflix/issues/12","number":12,"state":"open","locked":false,"title":"Week 6 admins and amazon","user":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"body":"* 3\tAssignment: Admin signs in\r\n* 6\tAssignment: Admin adds a video\r\n* 7\tAssignment: Watch video\r\n* 8\tAssignment: Feature test for adding video","created_at":"2015-10-21T17:35:20Z","updated_at":"2015-10-21T21:52:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05257e7d5e81fd41e0f55db285053d6d4728fead","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jepetko/myflix/pulls/12/commits","review_comments_url":"https://api.github.com/repos/jepetko/myflix/pulls/12/comments","review_comment_url":"https://api.github.com/repos/jepetko/myflix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jepetko/myflix/issues/12/comments","statuses_url":"https://api.github.com/repos/jepetko/myflix/statuses/aae865a0350a8bf530753d4c1ff917a65898e389","head":{"label":"jepetko:week-6-admins-and-amazon","ref":"week-6-admins-and-amazon","sha":"aae865a0350a8bf530753d4c1ff917a65898e389","user":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"repo":{"id":33948139,"name":"myflix","full_name":"jepetko/myflix","owner":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jepetko/myflix","description":"myflix tealeaf course application","fork":false,"url":"https://api.github.com/repos/jepetko/myflix","forks_url":"https://api.github.com/repos/jepetko/myflix/forks","keys_url":"https://api.github.com/repos/jepetko/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jepetko/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jepetko/myflix/teams","hooks_url":"https://api.github.com/repos/jepetko/myflix/hooks","issue_events_url":"https://api.github.com/repos/jepetko/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/jepetko/myflix/events","assignees_url":"https://api.github.com/repos/jepetko/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/jepetko/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/jepetko/myflix/tags","blobs_url":"https://api.github.com/repos/jepetko/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jepetko/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jepetko/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/jepetko/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jepetko/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/jepetko/myflix/languages","stargazers_url":"https://api.github.com/repos/jepetko/myflix/stargazers","contributors_url":"https://api.github.com/repos/jepetko/myflix/contributors","subscribers_url":"https://api.github.com/repos/jepetko/myflix/subscribers","subscription_url":"https://api.github.com/repos/jepetko/myflix/subscription","commits_url":"https://api.github.com/repos/jepetko/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/jepetko/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/jepetko/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/jepetko/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/jepetko/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/jepetko/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jepetko/myflix/merges","archive_url":"https://api.github.com/repos/jepetko/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jepetko/myflix/downloads","issues_url":"https://api.github.com/repos/jepetko/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/jepetko/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/jepetko/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/jepetko/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jepetko/myflix/labels{/name}","releases_url":"https://api.github.com/repos/jepetko/myflix/releases{/id}","created_at":"2015-04-14T18:01:44Z","updated_at":"2015-05-02T10:22:05Z","pushed_at":"2015-10-21T17:35:20Z","git_url":"git://github.com/jepetko/myflix.git","ssh_url":"git@github.com:jepetko/myflix.git","clone_url":"https://github.com/jepetko/myflix.git","svn_url":"https://github.com/jepetko/myflix","homepage":null,"size":824,"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":"jepetko:staging","ref":"staging","sha":"6ec50302145e3b31f0acb4baec45f98a09bfcd2d","user":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"repo":{"id":33948139,"name":"myflix","full_name":"jepetko/myflix","owner":{"login":"jepetko","id":1812641,"avatar_url":"https://avatars.githubusercontent.com/u/1812641?v=3","gravatar_id":"","url":"https://api.github.com/users/jepetko","html_url":"https://github.com/jepetko","followers_url":"https://api.github.com/users/jepetko/followers","following_url":"https://api.github.com/users/jepetko/following{/other_user}","gists_url":"https://api.github.com/users/jepetko/gists{/gist_id}","starred_url":"https://api.github.com/users/jepetko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jepetko/subscriptions","organizations_url":"https://api.github.com/users/jepetko/orgs","repos_url":"https://api.github.com/users/jepetko/repos","events_url":"https://api.github.com/users/jepetko/events{/privacy}","received_events_url":"https://api.github.com/users/jepetko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jepetko/myflix","description":"myflix tealeaf course application","fork":false,"url":"https://api.github.com/repos/jepetko/myflix","forks_url":"https://api.github.com/repos/jepetko/myflix/forks","keys_url":"https://api.github.com/repos/jepetko/myflix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jepetko/myflix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jepetko/myflix/teams","hooks_url":"https://api.github.com/repos/jepetko/myflix/hooks","issue_events_url":"https://api.github.com/repos/jepetko/myflix/issues/events{/number}","events_url":"https://api.github.com/repos/jepetko/myflix/events","assignees_url":"https://api.github.com/repos/jepetko/myflix/assignees{/user}","branches_url":"https://api.github.com/repos/jepetko/myflix/branches{/branch}","tags_url":"https://api.github.com/repos/jepetko/myflix/tags","blobs_url":"https://api.github.com/repos/jepetko/myflix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jepetko/myflix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jepetko/myflix/git/refs{/sha}","trees_url":"https://api.github.com/repos/jepetko/myflix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jepetko/myflix/statuses/{sha}","languages_url":"https://api.github.com/repos/jepetko/myflix/languages","stargazers_url":"https://api.github.com/repos/jepetko/myflix/stargazers","contributors_url":"https://api.github.com/repos/jepetko/myflix/contributors","subscribers_url":"https://api.github.com/repos/jepetko/myflix/subscribers","subscription_url":"https://api.github.com/repos/jepetko/myflix/subscription","commits_url":"https://api.github.com/repos/jepetko/myflix/commits{/sha}","git_commits_url":"https://api.github.com/repos/jepetko/myflix/git/commits{/sha}","comments_url":"https://api.github.com/repos/jepetko/myflix/comments{/number}","issue_comment_url":"https://api.github.com/repos/jepetko/myflix/issues/comments{/number}","contents_url":"https://api.github.com/repos/jepetko/myflix/contents/{+path}","compare_url":"https://api.github.com/repos/jepetko/myflix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jepetko/myflix/merges","archive_url":"https://api.github.com/repos/jepetko/myflix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jepetko/myflix/downloads","issues_url":"https://api.github.com/repos/jepetko/myflix/issues{/number}","pulls_url":"https://api.github.com/repos/jepetko/myflix/pulls{/number}","milestones_url":"https://api.github.com/repos/jepetko/myflix/milestones{/number}","notifications_url":"https://api.github.com/repos/jepetko/myflix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jepetko/myflix/labels{/name}","releases_url":"https://api.github.com/repos/jepetko/myflix/releases{/id}","created_at":"2015-04-14T18:01:44Z","updated_at":"2015-05-02T10:22:05Z","pushed_at":"2015-10-21T17:35:20Z","git_url":"git://github.com/jepetko/myflix.git","ssh_url":"git@github.com:jepetko/myflix.git","clone_url":"https://github.com/jepetko/myflix.git","svn_url":"https://github.com/jepetko/myflix","homepage":null,"size":824,"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/jepetko/myflix/pulls/12"},"html":{"href":"https://github.com/jepetko/myflix/pull/12"},"issue":{"href":"https://api.github.com/repos/jepetko/myflix/issues/12"},"comments":{"href":"https://api.github.com/repos/jepetko/myflix/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jepetko/myflix/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/jepetko/myflix/statuses/aae865a0350a8bf530753d4c1ff917a65898e389"}}}}