Skip to content
Browse files

added tests for filesystem storage

  • Loading branch information...
1 parent 1b8bb3c commit 88a65aafb7cfab1a325e676e0c9d78c317699665 @tilsammans tilsammans committed Jan 14, 2011
Showing with 23 additions and 0 deletions.
  1. +23 −0 test/storage_test.rb
View
23 test/storage_test.rb
@@ -7,6 +7,29 @@ def rails_env(env)
Object.const_set(:Rails, stub('Rails', :env => env))
end
end
+
+ context "filesystem" do
+ setup do
+ rebuild_model :styles => { :thumbnail => "25x25#" }
+ @dummy = Dummy.create!
+
+ @dummy.avatar = File.open(File.join(File.dirname(__FILE__), "fixtures", "5k.png"))
+ end
+
+ should "allow file assignment" do
+ assert @dummy.save
+ end
+
+ should "store the original" do
+ @dummy.save
+ assert File.exists?(@dummy.avatar.path)
+ end
+
+ should "store the thumbnail" do
+ @dummy.save
+ assert File.exists?(@dummy.avatar.path(:thumbnail))
+ end
+ end
context "Parsing S3 credentials" do
setup do

0 comments on commit 88a65aa

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