Commit 54093c67 by Pavel Forkert Committed by Prem Sichanugrist

Add test for raising error when there is no class in specified namespace

parent 119a44b5
......@@ -42,6 +42,14 @@ class PaperclipTest < Test::Unit::TestCase
assert_equal ::One::Two, Paperclip.class_for("One::Two")
end
should "raise when class doesn't exist in specified namespace" do
class ::Three; end
class ::Four; end
assert_raise NameError do
Paperclip.class_for("Three::Four")
end
end
context "An ActiveRecord model with an 'avatar' attachment" do
setup do
rebuild_model :path => "tmp/:class/omg/:style.:extension"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment