Permalink
Browse files

Encode videos after uploading them

  • Loading branch information...
1 parent 86a6abe commit 6894e9b053ed36de07b9e51da3b189b877a94226 @kwiest committed May 8, 2012
Showing with 2 additions and 0 deletions.
  1. +1 −0 app/controllers/videos_controller.rb
  2. +1 −0 spec/controllers/videos_controller_spec.rb
@@ -23,6 +23,7 @@ def new
def create
@video = current_user.videos.create(params[:video])
if @video.save
+ @video.encode!
redirect_to videos_path, notice: 'Video successfully uploaded. Please give it a few minutes to encode.'
else
render template: 'shared/videos/new'
@@ -57,6 +57,7 @@
it 'should create a new video and redirect to the videos path if valid params are sent' do
video.stub(:save) { true }
+ video.should_receive(:encode!) { true }
post :create
assigns(:video).should == video

0 comments on commit 6894e9b

Please sign in to comment.