Permalink
Browse files

title cards now correctly set their 'type' in manifests

  • Loading branch information...
1 parent 8ae99cd commit d22d52e423c4ebb7c5d102edf4b45443a2a4f8ae Sander Hartlage committed Apr 28, 2011
Showing with 7 additions and 2 deletions.
  1. +2 −2 lib/animoto/assets/title_card.rb
  2. +5 −0 spec/animoto/assets/title_card_spec.rb
@@ -36,12 +36,12 @@ def initialize title, subtitle = nil, options = {}
#
# @return [Hash{String=>Object}] this TitleCard as a Hash
def to_hash
- hash = {}
+ hash = { 'type' => 'title_card' }
hash['h1'] = title
hash['h2'] = subtitle if subtitle
hash['spotlit'] = spotlit? unless @spotlit.nil?
hash
end
end
end
-end
+end
@@ -25,6 +25,11 @@
@card = Animoto::Assets::TitleCard.new("hooray")
end
+ it "should have type 'title_card'" do
+ @card.to_hash.should have_key('type')
+ @card.to_hash['type'].should == 'title_card'
+ end
+
it "should have an 'h1' key with the title" do
@card.to_hash.should have_key('h1')
@card.to_hash['h1'].should == @card.title

0 comments on commit d22d52e

Please sign in to comment.