./spec/animoto/assets/base_spec.rb in animoto-1.1.1 vs ./spec/animoto/assets/base_spec.rb in animoto-1.2.0

- old
+ new

@@ -1,5 +1,27 @@ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper") describe Animoto::Assets::Base do + describe "initialization" do + before do + @source = 'http://website.com/asset' + @asset = Animoto::Assets::Base.new @source + end + + it "should set the source from the given source url" do + @asset.source.should == @source + end + end + + describe "#to_hash" do + before do + @asset = Animoto::Assets::Base.new 'http://website.com/asset' + end + + it "should have a 'source_url' key with the url" do + @asset.to_hash.should have_key('source_url') + @asset.to_hash['source_url'].should == @asset.source + end + end + end \ No newline at end of file