test/test_imagery.rb in imagery-0.0.2 vs test/test_imagery.rb in imagery-0.0.3
- old
+ new
@@ -14,10 +14,18 @@
test "key" do
assert_equal '1001', Imagery.new(Photo.new(1001)).key
end
+ test "root_path when root not defined" do
+ imagery = Imagery.new(Photo.new(1001))
+
+ assert_raise Imagery::Model::UndefinedRoot do
+ imagery.file
+ end
+ end
+
test "root_path when no ROOT_DIR" do
imagery = Imagery.new(Photo.new(1001))
imagery.root = '/'
assert_equal "/public/system/photo/1001/tmp", imagery.send(:tmp)
end
@@ -117,10 +125,10 @@
assert ! File.exist?(@imagery.file(:large))
end
test "when mode == :fake" do
time = Benchmark.realtime {
- Imagery.faked {
+ Imagery::Model.faked {
assert @imagery.save(File.open(FIXTURES + '/lake.jpg'))
}
}
assert time < 0.01, "Faked context should run in less than 0.01 secs"