<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -27,6 +27,7 @@ Private beta release
 
 Beta R2
 -------
+* Statues for profiles
 * Migration script
 * Split api auth into a separate gem
 * Look into yamdi instead of flvtool</diff>
      <filename>TODO.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -21,9 +21,9 @@ module Panda
       hmac.update( string_to_sign )
       # chomp is important!  the base64 encoded version will have a newline at the end
       signature = Base64.encode64(hmac.digest).chomp 
-      puts &quot;STRING TO SIGN&quot;
-      puts string_to_sign
-      puts &quot;SIGNATURE: #{signature}&quot;
+      # puts &quot;STRING TO SIGN&quot;
+      # puts string_to_sign
+      # puts &quot;SIGNATURE: #{signature}&quot;
       return signature
 		end
 		</diff>
      <filename>lib/api_authentication.rb</filename>
    </modified>
    <modified>
      <diff>@@ -155,7 +155,7 @@ module Panda
     end
 
     get '/encodings/:id.*' do
-      display_response(Encoding.find(params[:idorstatus]), params[:splat].first)
+      display_response(Encoding.find(params[:id]), params[:splat].first)
     end
 
     post '/encodings.*' do</diff>
      <filename>lib/server.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,12 +22,13 @@ describe 'API' do
   before do
     [Video, Encoding, Profile].each {|m| m.find(:all).each {|v| v.delete } }
     
-    @video_hash = {:duration =&gt; 99, :width =&gt; 320, :height =&gt; 240, :fps =&gt; 24, :extname =&gt; '.mp4', :original_filename =&gt; 'panda.mp4', :video_codec =&gt; 'h264', :audio_codec =&gt; 'aac', :thumbnail_position =&gt; '50', :upload_redirect_url =&gt; 'http://localhost/upload_redirect_url/$id', :state_update_url =&gt; 'http://localhost/state_update_url/$id'}
+    @video_hash = {:duration =&gt; 99, :width =&gt; 320, :height =&gt; 240, :fps =&gt; 24, :extname =&gt; '.mp4', :original_filename =&gt; 'panda.mp4', :video_codec =&gt; 'h264', :audio_codec =&gt; 'aac', :thumbnail_position =&gt; '50', :upload_redirect_url =&gt; 'http://localhost/upload_redirect_url/$id', :state_update_url =&gt; 'http://localhost/state_update_url/$id', :upload_key =&gt; 'abc123'}
     @video = Video.create(@video_hash)
     
     @video_upload_hash = {:file =&gt; Rack::Test::UploadedFile.new(File.join(File.dirname(__FILE__),'panda.mp4'), &quot;application/octet-stream&quot;, true), 
       :upload_redirect_url =&gt; 'http://localhost/upload_redirect_url/$id',
-      :state_update_url =&gt; 'http://localhost/state_update_url/$id' }
+      :state_update_url =&gt; 'http://localhost/state_update_url/$id',
+      :upload_key =&gt; 'abc123' }
     
     @profile_hash = {:category =&gt; &quot;Flash flv&quot;, :title =&gt; &quot;Medium&quot;, :width =&gt; 320, :height =&gt; 240, :extname =&gt; &quot;.flv&quot;, :command =&gt; &quot;ffmpeg -i $input_file$ -ar 22050 -ab 64k -f flv -b 256k $resolution_and_padding$ -y $output_file$\nflvtool2 -U $output_file$&quot;}
     @profile = Profile.create(@profile_hash)
@@ -56,14 +57,14 @@ describe 'API' do
   # Video upload
   
   it &quot;posts /videos.json and also create encodings&quot; do
-    request_with_auth(:post, &quot;/videos.json&quot;, @video_upload_hash.merge({:upload_key =&gt; UUID.timestamp_create().to_s}))
+    request_with_auth(:post, &quot;/videos.json&quot;, @video_upload_hash)
     
     last_request.POST[&quot;file&quot;][:filename].should == &quot;panda.mp4&quot;
     last_request.POST[&quot;file&quot;][:type].should == &quot;application/octet-stream&quot;
     last_response.should be_ok
     # TODO: test windows filenames stripiing
     created_video_hash = JSON.parse(last_response.body)
-    created_video_hash.should eql_hash({:duration =&gt; 14000, :width =&gt; 300, :height =&gt; 240, :fps =&gt; 29, :extname =&gt; '.mp4', :original_filename =&gt; 'panda.mp4', :video_codec =&gt; 'h264', :audio_codec =&gt; 'aac', :thumbnail_position =&gt; nil, :upload_redirect_url =&gt; 'http://localhost/upload_redirect_url/$id', :state_update_url =&gt; 'http://localhost/state_update_url/$id'})
+    created_video_hash.should eql_hash({:duration =&gt; 14000, :width =&gt; 300, :height =&gt; 240, :fps =&gt; 29, :extname =&gt; '.mp4', :original_filename =&gt; 'panda.mp4', :video_codec =&gt; 'h264', :audio_codec =&gt; 'aac', :thumbnail_position =&gt; nil, :upload_redirect_url =&gt; 'http://localhost/upload_redirect_url/$id', :state_update_url =&gt; 'http://localhost/state_update_url/$id', :upload_key =&gt; 'abc123'})
     
     request_with_auth(:get, &quot;/videos/#{created_video_hash['id']}/encodings.json&quot;)
     created_encoding_hash = JSON.parse(last_response.body).first
@@ -109,12 +110,6 @@ describe 'API' do
     last_response.should be_ok
     JSON.parse(last_response.body).should eql_hash(@video_hash)
   end
-    
-  it &quot;gets /videos/upload/:upload_key.json&quot; do
-    request_with_auth(:get, &quot;/videos/upload/#{@video.upload_key}.json&quot;)
-    last_response.should be_ok
-    JSON.parse(last_response.body).should eql_hash(@video_hash)
-  end
   
   it &quot;puts /videos/:id.json&quot; do
     request_with_auth(:put, &quot;/videos/#{@video.id}.json&quot;, {:upload_redirect_url =&gt; &quot;xxx&quot;})
@@ -148,11 +143,11 @@ describe 'API' do
   end
   
   it &quot;gets /encodings.json?status=:status&quot; do
-    request_with_auth(:get, &quot;/encodings.json?status=error&quot;)
+    request_with_auth(:get, &quot;/encodings.json&quot;, {:status =&gt; 'error'})
     last_response.should be_ok
     Encoding.find(:all, :conditions =&gt; [&quot;status=?&quot;,'error']).size.should == 0
     
-    request_with_auth(:get, &quot;/encodings.json?status=queued&quot;)
+    request_with_auth(:get, &quot;/encodings.json&quot;, {:status =&gt; 'queued'})
     last_response.should be_ok
     JSON.parse(last_response.body).first.should eql_hash(@encoding_hash)
   end
@@ -237,7 +232,7 @@ describe 'API' do
    request_with_auth(:delete, &quot;/profiles/#{@profile.id}.json&quot;)
    Profile.find(:all, :conditions =&gt; [&quot;id=?&quot;,@profile.id]).size.should == 1
    last_response.status.should == 422
-   JSON.parse(last_response.body).should eql_hash({:message =&gt; &quot;Couldn't delete Profile with ID=#{@profile.id} as it has associated encodings which must be deleted first&quot;, :error =&gt; &quot;CannotDelete&quot;})
+   JSON.parse(last_response.body).should eql_hash({:message =&gt; &quot;Couldn't delete Profile with ID=#{@profile.id} as it has associated encodings which must be deleted first. Maybe you want to disable the Profile instead by updating its status attribute to 'disabled'?&quot;, :error =&gt; &quot;CannotDelete&quot;})
   end
   
   it &quot;deletes /profiles/:id.json&quot; do</diff>
      <filename>test/server.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b932f46d9081f7074228c270fbc18b1cd6a28789</id>
    </parent>
  </parents>
  <author>
    <name>Damien Tanner</name>
    <email>damien@new-bamboo.co.uk</email>
  </author>
  <url>http://github.com/newbamboo/panda/commit/4b6a57ae209ccbb09af245535bc569cea06b9e4c</url>
  <id>4b6a57ae209ccbb09af245535bc569cea06b9e4c</id>
  <committed-date>2009-10-20T08:58:02-07:00</committed-date>
  <authored-date>2009-10-20T08:58:02-07:00</authored-date>
  <message>Fix specs.</message>
  <tree>aa413ba5eda2124a0d8a50f48e69934c1cdffd64</tree>
  <committer>
    <name>Damien Tanner</name>
    <email>damien@new-bamboo.co.uk</email>
  </committer>
</commit>
