search for: testuploadedfile

Displaying 7 results from an estimated 7 matches for "testuploadedfile".

2007 Jul 01
0
rake: uninitialized const ActionController::TestUploadedFile
...de]desc "Upload template files" task :upload_files_test => :environment do |t| conf = Conference.find(1) [{:f => ''styles.css'', :type_code => ''css'', :content_type => ''text/css''}].each do |i| file = ActionController::TestUploadedFile.new("db/migrate/widgets_layout/" + i[:f], i[:content_type]) conf.conference_files.create(:uploaded_data => file) end end[/code] But I get the rake error uninitialized constant ActionController::TestUploadedFile If I start the console, ActionController::TestUploadedFile.new wor...
2007 Dec 11
14
Attachment-fu + Story Runner
...pecifying the file data, from custom mocks: class MockFile < Struct.new (:original_filename, :read, :content_type); end fdata = MockFile.new "test_upload.txt", "Test Upload", "text/plain" to ''proper'' railsy stubs like: fdata = ActionController::TestUploadedFile.new("../spec/fixtures/ test_upload.txt", "text/plain") The actual params are specified as: { :uploaded_data => fdata, :filename => file_reference_name(identifier) } Now, this is being passed successfully into attachment-fu, where it is processed. Well, almost...
2008 Jan 21
5
attachment_fu and story runner, any updates
I''m trying to write a story for a Rails app which involves using the attachment_fu plugin to upload images. After blunting my pick on this for a while, google found me this: http://www.ruby-forum.com/topic/134743#600831 So it seems that there''s a hole in Rails integration testing and multipart form posting. David offered to incorporate a patch to story runner at the end of the
2007 Nov 09
9
fixture_file_upload and edge rspec?
Hi all, I had some specs that were using fixture_file_upload that were passing just fine. Then I froze edge rails to get some 2.0 functionality, then a I upgraded to trunk rspec to deal with uninitialized constant ActionView::Helpers::JavaScriptMacrosHelper After a couple other of tribulations, I have now gotten down to just a couple of not passing specs, all using the fixture_file_upload.
2009 Aug 17
0
Paperclip: processor proc not firing
...thout processing, all as intended): it "should capture a video frame from video files (mimetyped test)" do test_file = ''./spec/models/files/dirt.mov'' mimetype = ''video/quicktime'' doc = Document.new(:asset => ActionController::TestUploadedFile.new(test_file, mimetype)) lambda {doc.save!}.should_not raise_error end I''m mimicking an actual upload to stay as close to the real web interaction as possible. It bombs with (making the test fail): identify: no decode delegate for this image format `/var/folders/uQ/ uQCnby5G...
2007 Mar 11
4
Faking it... import local files into attachment_fu
Hello, I''m working on an import utility that will match the functionality of uploading an object of a model that uses attachment_fu for thumbnailing, etc. Rather than uploading the file via a form, I want to populate the params[:image][:uploaded_data] with data from a file already on the server''s file system. So far, I''ve been able to copy to an instance of Tempfile
2006 Jun 01
9
More flexible file column?
The file column plug-in is great, but there is a problem with it. Well, two... But the other is well documented now. :^) Consider a time when you''ve created a CMS for a client and it''s been in use for over a year. Say 1500+ images have been uploaded so far. Now the client comes back with a simple request... ''Can you change the thumbnail size to 80/90, rather than