Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Encode videos after uploading them

  • Loading branch information...
commit 6894e9b053ed36de07b9e51da3b189b877a94226 1 parent 86a6abe
Kyle Wiest authored May 08, 2012
1  app/controllers/videos_controller.rb
@@ -23,6 +23,7 @@ def new
23 23
   def create
24 24
     @video = current_user.videos.create(params[:video])
25 25
     if @video.save
  26
+      @video.encode!
26 27
       redirect_to videos_path, notice: 'Video successfully uploaded. Please give it a few minutes to encode.'
27 28
     else
28 29
       render template: 'shared/videos/new'
1  spec/controllers/videos_controller_spec.rb
@@ -57,6 +57,7 @@
57 57
 
58 58
     it 'should create a new video and redirect to the videos path if valid params are sent' do
59 59
       video.stub(:save) { true }
  60
+      video.should_receive(:encode!) { true }
60 61
 
61 62
       post :create
62 63
       assigns(:video).should == video

0 notes on commit 6894e9b

Please sign in to comment.
Something went wrong with that request. Please try again.