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

- old
+ new

@@ -9,26 +9,66 @@ describe "initializing" do it "should specify the title of the manifest as the first argument" do manifest(:title => "Funderful Wonderment").title.should == "Funderful Wonderment" end - it "should default to 'default' pacing" do - manifest.pacing.should == 'default' + it "should default to 'auto' pacing" do + manifest.pacing.should == 'auto' end it "should be able to specify the pacing with a :pacing parameter" do - manifest(:pacing => 'double').pacing.should == 'double' + manifest(:pacing => 'fast').pacing.should == 'fast' end it "should default to 'original' style" do - manifest.style.should == 'original' + manifest.style.should == Animoto::Styles::ORIGINAL end + + it "should be able to specify the style with a :style parameter" do + manifest(:style => Animoto::Styles::VINTAGE).style.should == Animoto::Styles::VINTAGE + end + + it "should default to having the 'powered by animoto' postroll" do + manifest.postroll.should == Animoto::Postroll::POWERED_BY_ANIMOTO + end + + it "should be able to specify the postroll with a :postroll parameter" do + manifest(:postroll => Animoto::Postroll::WHITE_LABEL).postroll.should == Animoto::Postroll::WHITE_LABEL + end - it "should default to having to visuals" do + it "should default to having no visuals" do manifest.visuals.should be_empty end end + + describe "setting the postroll" do + before do + @manifest = manifest() + end + + describe "with a string" do + before do + @postroll = "fancy" + @manifest.postroll = @postroll + end + + it "should set the postroll to a new postroll object with the given template" do + @manifest.postroll.template.should == @postroll + end + end + + describe "with another Postroll" do + before do + @postroll = Animoto::Postroll::CustomFootage.new("http://postrollz.com/postroll.mp4") + @manifest.postroll = @postroll + end + + it "should set the postroll to the given postroll object" do + @manifest.postroll.should eql(@postroll) + end + end + end describe "adding assets" do describe "using the append operator" do before do @title_card = Animoto::Assets::TitleCard.new "woohoo!" @@ -117,10 +157,15 @@ it "should have a 'song' object in the manifest" do manifest.to_hash['directing_job']['directing_manifest'].should have_key('song') manifest.to_hash['directing_job']['directing_manifest']['song'].should be_a(Hash) end + + it "should have a 'postroll' object in the manifest" do + manifest.to_hash['directing_job']['directing_manifest'].should have_key('postroll') + manifest.to_hash['directing_job']['directing_manifest']['postroll'].should be_a(Hash) + end describe "when the callback url is set" do before do manifest.http_callback_url = 'http://website.com/callback' end @@ -168,6 +213,6 @@ it "should have info about the song" do @song.should == @song_obj.to_hash end end end -end \ No newline at end of file +end