./spec/animoto/manifests/rendering_spec.rb in animoto-1.3.1 vs ./spec/animoto/manifests/rendering_spec.rb in animoto-1.5.0

- old
+ new

@@ -34,18 +34,22 @@ it "should take :http_callback_url and :http_callback_format parameters to set the callback" do manifest(:http_callback_url => "http://website.com/callback", :http_callback_format => 'xml') manifest.http_callback_url.should == "http://website.com/callback" manifest.http_callback_format.should == 'xml' end + + it "should take a :streaming parameter to set streaming" do + manifest(:streaming => true).streaming?.should be_true + end end describe "generating a hash" do before do @storyboard = Animoto::Resources::Storyboard.new @url = "http://platform.animoto.com/storyboards/1" @storyboard.instance_variable_set(:@url, @url) - manifest(@storyboard, :resolution => "720p", :framerate => 24, :format => 'flv') + manifest(@storyboard, :resolution => "720p", :framerate => 24, :format => 'flv', :streaming => true) end it "should have a top-level 'rendering_job' object" do manifest.to_hash.should have_key('rendering_job') manifest.to_hash['rendering_job'].should be_a(Hash) @@ -80,10 +84,25 @@ end it "should have a 'format' key" do @profile['format'].should == manifest.format end + + describe "streaming parameters" do + before do + @streaming_params = manifest.to_hash['rendering_job']['rendering_manifest']['rendering_parameters']['streaming_parameters'] + end + + it "should be present if streaming is enabled" do + @streaming_params.should_not be_nil + end + + it "should have a 'format' key with the streaming format" do + @streaming_params.should have_key('format') + @streaming_params['format'].should == manifest.instance_variable_get(:@streaming_format) + end + end end describe "when an HTTP callback is set" do before do manifest.http_callback_url = "http://website.com/callback" @@ -110,6 +129,6 @@ manifest.to_hash['rendering_job']['http_callback_format'].should == manifest.http_callback_format end end end end -end \ No newline at end of file +end