public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
fix test that breaks in multi-site mode [courtenay]

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2543 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Tue Dec 12 20:36:26 -0800 2006
commit  5307c8b5004fe268e5d232e75a9c2814d0a22b4a
tree    e95a7c48ac9158e2505296b85aee85d895dca1ee
parent  b0aa4b2f2dc07ce4ce5804e65da106ea74605716
...
2
3
4
5
 
6
7
8
...
17
18
19
20
 
21
22
23
24
25
26
 
27
28
29
...
32
33
34
 
35
36
37
38
39
40
 
41
42
43
...
168
169
170
171
 
172
173
174
...
2
3
4
 
5
6
7
8
...
17
18
19
 
20
21
22
23
24
25
26
27
28
29
30
...
33
34
35
36
37
38
39
40
41
 
42
43
44
45
...
170
171
172
 
173
174
175
176
0
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../test_helper'
0
 
0
 class AssetTest < Test::Unit::TestCase
0
   fixtures :sites, :assets, :tags, :taggings
0
-
0
+
0
   def test_should_upload_and_create_asset_records
0
     asset_count = Object.const_defined?(:Magick) ? 3 : 1 # asset + 2 thumbnails
0
     
0
@@ -17,13 +17,14 @@ class AssetTest < Test::Unit::TestCase
0
       end
0
     end
0
   end
0
-
0
+
0
   def test_should_upload_file
0
     process_upload
0
     assert_assets_exist :logo
0
   end
0
 
0
   def test_should_rename_non_unique_filename
0
+ Site.multi_sites_enabled = false
0
     asset = process_upload
0
     assert_equal 'logo.png', asset.filename
0
     asset = process_upload
0
@@ -32,12 +33,13 @@ class AssetTest < Test::Unit::TestCase
0
   end
0
 
0
   def test_should_rename_non_unique_filename_when_renaming
0
+ Site.multi_sites_enabled = false
0
     now = Time.now.utc
0
     asset = process_upload
0
     assert_equal 'logo.png', asset.filename
0
     asset = process_upload(:filename => 'logo_reloaded.png')
0
     assert_assets_exist :logo_reloaded, now
0
-
0
+
0
     asset.update_attributes :filename => 'logo.png'
0
     assert_file_exists File.join(ASSET_PATH, now.year.to_s, now.month.to_s, now.day.to_s, "logo_1.png")
0
   end
0
@@ -168,7 +170,7 @@ class AssetTest < Test::Unit::TestCase
0
   protected
0
     def process_upload(options = {})
0
       a = sites(:first).assets.create(options.reverse_merge(:filename => 'logo.png', :content_type => 'image/png',
0
- :attachment_data => IO.read(File.join(RAILS_ROOT, 'public/images/mephisto/logo.png'))))
0
+ :attachment_data => IO.read(File.join(RAILS_ROOT, 'public','images','mephisto','logo.png'))))
0
       assert_valid a
0
       a
0
     end

Comments

    No one has commented yet.