Skip to content

Instantly share code, notes, and snippets.

@yaroslav
Created August 26, 2008 09:14
Show Gist options
  • Save yaroslav/7240 to your computer and use it in GitHub Desktop.
Save yaroslav/7240 to your computer and use it in GitHub Desktop.
attachment_fu spec helper
# attachment_fu spec helper.
#
# Usage:
#
# before(:all) do
# before_attachment_fu(Avatar)
# end
#
# it "should do weird stuff with avatar" do
# avatar = Avatar.new
#
# ...
# end
def before_attachment_fu(klass)
klass.attachment_options[:storage] = :file_system
klass.any_instance.expects(:save_to_storage).returns(true)
klass.any_instance.expects(:process_attachment).returns(true)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment