Revisions
-
technicalpickles revised this gist
Aug 5, 2009 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ Factory.define :application do |factory| factory.attachment(:sample, "public/samples/sample.doc", "application/msword") end -
technicalpickles revised this gist
Aug 5, 2009 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Factory.define :application do |factory| factory.attachment("public/samples/sample.doc", "application/msword") end -
technicalpickles renamed this gist
Aug 5, 2009 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
technicalpickles revised this gist
Aug 5, 2009 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,12 +3,11 @@ def attachment(name, path, content_type = nil) path_with_rails_root = "#{RAILS_ROOT}/#{path}" uploaded_file = if content_type ActionController::TestUploadedFile.new(path_with_rails_root, content_type) else ActionController::TestUploadedFile.new(path_with_rails_root) end add_attribute name, uploaded_file end end -
technicalpickles created this gist
Aug 5, 2009 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ require 'action_controller/test_process' Factory.class_eval do def attachment(name, path, content_type = nil) path_with_rails_root = "#{RAILS_ROOT}/#{path}" uploaded_file = if content_type ActionController::TestUploadedFile.new(path_with_rails_root, 'image/jpeg') else ActionController::TestUploadedFile.new(path_with_rails_root) end add_attribute name, uploaded_file end end