From 98559d91d2363170b97540c1561469a220513020 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 20 Jan 2010 14:12:19 -0300 Subject: [PATCH] Using existing image; don't create it on the fly --- test/functional/cms_controller_test.rb | 7 +------ test/functional/content_viewer_controller_test.rb | 9 ++------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index 7b67457..a3132f5 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -1058,19 +1058,14 @@ class CmsControllerTest < Test::Unit::TestCase should 'display pagination links of images' do @controller.stubs(:per_page).returns(1) - fixture_filename = '/files/other-pic.jpg' - filename = RAILS_ROOT + '/test/fixtures' + fixture_filename - system('echo "image for test" | convert -background yellow -page 32x32 text:- %s' % filename) - image = UploadedFile.create!(:profile => profile, :uploaded_data => fixture_file_upload(fixture_filename, 'image/jpg')) + image = UploadedFile.create!(:profile => profile, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg')) image2 = UploadedFile.create!(:profile => profile, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :created_at => 1.day.ago) get :media_listing, :profile => profile.identifier assert_includes assigns(:images), image assert_not_includes assigns(:images), image2 - - File.rm_f(filename) end should 'display pagination links of documents' do diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index 5d0ecf3..92f9b5e 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -806,17 +806,12 @@ class ContentViewerControllerTest < Test::Unit::TestCase @controller.stubs(:per_page).returns(1) folder = Folder.create!(:name => 'gallery', :profile => profile, :view_as => 'image_gallery') - fixture_filename = '/files/other-pic.jpg' - filename = RAILS_ROOT + '/test/fixtures' + fixture_filename - system('echo "image for test" | convert -background yellow -page 32x32 text:- %s' % filename) - image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload(fixture_filename, 'image/jpg')) - + image1 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg')) image2 = UploadedFile.create!(:profile => profile, :parent => folder, :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')) + get :view_page, :profile => profile.identifier, :page => folder.explode_path, :slideshow => true assert_equal 2, assigns(:images).size - - File.rm_f(filename) end should 'display source from article' do -- libgit2 0.21.2