Skip to content
Browse files

Added a few tests for font and music files.

  • Loading branch information...
1 parent ae050e3 commit 7ac3e198c79b6f3927ed62113094ebfbf0e0d0c9 @jnunemaker committed Jan 22, 2011
Showing with 30 additions and 0 deletions.
  1. BIN test/fixtures/example.m4r
  2. BIN test/fixtures/font.eot
  3. +30 −0 test/test_joint.rb
View
BIN test/fixtures/example.m4r
Binary file not shown.
View
BIN test/fixtures/font.eot
Binary file not shown.
View
30 test/test_joint.rb
@@ -361,4 +361,34 @@ def @image.original_filename
@asset.file.read.should == 'This is my stuff'
end
end
+
+ context "A font file" do
+ setup do
+ @file = open_file('font.eot')
+ @doc = Asset.create(:file => @file)
+ end
+ subject { @doc }
+
+ should "assign joint keys" do
+ subject.file_size.should == 17610
+ subject.file_type.should == "application/octet-stream"
+ subject.file_id.should_not be_nil
+ subject.file_id.should be_instance_of(BSON::ObjectId)
+ end
+ end
+
+ context "A music file" do
+ setup do
+ @file = open_file('example.m4r')
+ @doc = Asset.create(:file => @file)
+ end
+ subject { @doc }
+
+ should "assign joint keys" do
+ subject.file_size.should == 50790
+ subject.file_type.should == "audio/mp4"
+ subject.file_id.should_not be_nil
+ subject.file_id.should be_instance_of(BSON::ObjectId)
+ end
+ end
end

0 comments on commit 7ac3e19

Please sign in to comment.
Something went wrong with that request. Please try again.