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 !
Small bug fixes

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2722 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Tue Jan 30 07:48:35 -0800 2007
commit  900cc1c44192d601787e7a0e182ef3395580a1b4
tree    7fbfae0ede1e2b207564772c86c44b04d5ff0eed
parent  769eb0fe49691b965122f29e7ecaffe28bf9236d
...
1
2
 
 
 
 
 
 
3
4
5
...
1
2
3
4
5
6
7
8
9
10
11
0
@@ -1,5 +1,11 @@
0
 * SVN *
0
 
0
+* Small bug fixes
0
+ - show correct asset thumbnail url
0
+ - assert with correct named asset resource route
0
+ - add missing fixtures for About Section Feed Test
0
+ - update asset labeling tests to reflect current behavior
0
+
0
 * RESTRICT hyphens as a possible separator for permalink styles. [Chris Wanstrath]
0
 
0
 * Initial article/asset assignment support. Perfect for podcasting.
...
27
28
29
30
31
32
 
 
33
34
35
...
47
48
49
50
 
51
52
53
54
55
 
56
57
58
59
60
 
61
62
63
...
78
79
80
81
 
82
83
 
84
85
86
...
27
28
29
 
 
30
31
32
33
34
35
...
47
48
49
 
50
51
52
53
54
 
55
56
57
58
59
 
60
61
62
63
...
78
79
80
 
81
82
 
83
84
85
86
0
@@ -27,9 +27,9 @@ class ApplicationController < ActionController::Base
0
       elsif asset.other?
0
         ['/images/mephisto/icons/doc.png', options]
0
       elsif asset.thumbnails_count.zero?
0
- [asset.public_filename(thumbnail), options]
0
- else
0
         [asset.public_filename, options]
0
+ else
0
+ [asset.public_filename(thumbnail), options]
0
       end
0
     end
0
     helper_method :asset_image_args_for
0
@@ -47,17 +47,17 @@ class ApplicationController < ActionController::Base
0
         # use collect so it doesn't modify @articles
0
         assigns['articles'] = assigns['articles'].collect &:to_liquid
0
       end
0
- status = (assigns.delete(:status) || '200 OK')
0
+ status = (assigns.delete(:status) || :ok)
0
       @liquid_assigns = assigns
0
       render :text => site.render_liquid_for(@section, template_type, assigns, self), :status => status
0
     end
0
 
0
- def show_error(message = 'An error occurred.', status = '500 Error')
0
+ def show_error(message = 'An error occurred.', status = :internal_server_error)
0
       render_liquid_template_for(:error, 'message' => message, :status => status)
0
     end
0
 
0
     def show_404
0
- show_error 'Page Not Found', '404 NotFound'
0
+ show_error 'Page Not Found', :not_found
0
     end
0
 
0
     def set_cache_root
0
@@ -78,9 +78,9 @@ class ApplicationController < ActionController::Base
0
       exception.backtrace.each { |t| logger.debug " > #{t}" }
0
       case exception
0
         when ActiveRecord::RecordNotFound, ::ActionController::UnknownController, ::ActionController::UnknownAction
0
- render :file => File.join(RAILS_ROOT, 'public/404.html'), :status => '404 Not Found'
0
+ render :file => File.join(RAILS_ROOT, 'public/404.html'), :status => :not_found
0
         else
0
- render :file => File.join(RAILS_ROOT, 'public/500.html'), :status => '500 Error'
0
+ render :file => File.join(RAILS_ROOT, 'public/500.html'), :status => :internal_server_error
0
       end
0
     end
0
 end
...
46
47
48
49
50
 
 
 
51
52
53
54
 
 
 
55
56
57
...
46
47
48
 
 
49
50
51
52
53
 
 
54
55
56
57
58
59
0
@@ -46,11 +46,13 @@ module DropFilters
0
     liquify(*@context['site'].source.articles.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'contents.created_at desc'))
0
   end
0
   
0
- def assets_by_type(type)
0
- liquify(*@context['site'].source.assets.find_all_by_content_types([type.to_sym], :all, :order => 'created_at desc'))
0
+ def assets_by_type(type, drop = nil)
0
+ drop ||= @context['site']
0
+ liquify(*drop.source.assets.find_all_by_content_types([type.to_sym], :all, :order => 'created_at desc'))
0
   end
0
   
0
- def tagged_assets(tags)
0
- liquify(*@context['site'].source.assets.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'assets.created_at desc'))
0
+ def tagged_assets(tags, drop = nil)
0
+ drop ||= @context['site']
0
+ liquify(*drop.source.assets.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'assets.created_at desc'))
0
   end
0
 end
0
\ No newline at end of file
...
96
97
98
99
 
100
101
102
103
104
105
106
107
 
108
109
110
111
112
113
...
96
97
98
 
99
100
101
 
102
103
104
105
 
106
107
108
 
109
110
111
0
@@ -96,18 +96,16 @@ class Admin::ArticlesControllerAssetsTest < Test::Unit::TestCase
0
 
0
   specify "should add asset to article" do
0
     assert_difference AssignedAsset, :count do
0
- post :attach, :id => contents(:welcome).id, :version => assets(:mov).id, :label => 'avatar'
0
+ post :attach, :id => contents(:welcome).id, :version => assets(:mov).id
0
     end
0
     assert_models_equal [assets(:gif), assets(:mp3), assets(:mov)], contents(:welcome).assets(true)
0
- assert_equal 'avatar', contents(:welcome).assets[2].label
0
   end
0
   
0
   specify "should add inactive asset to article" do
0
     assert_no_difference AssignedAsset, :count do
0
- post :attach, :id => contents(:welcome).id, :version => assets(:png).id, :label => 'avatar'
0
+ post :attach, :id => contents(:welcome).id, :version => assets(:png).id
0
     end
0
     assert_models_equal [assets(:gif), assets(:mp3), assets(:png)], contents(:welcome).assets(true)
0
- assert_equal 'avatar', contents(:welcome).assets[2].label
0
   end
0
 
0
   specify "should find deactivate article assets" do
...
29
30
31
32
 
33
34
35
...
29
30
31
 
32
33
34
35
0
@@ -29,7 +29,7 @@ class Admin::AssetsControllerPermissionsTest < Test::Unit::TestCase
0
         assert_equal users(:ben).id, assigns(:assets).first.user_id
0
         assert_equal 'logo.png', assigns(:assets).first.title
0
         assert_match /logo\.png/, flash[:notice]
0
- assert_redirected_to asset_path
0
+ assert_redirected_to assets_path
0
       end
0
     end
0
   end
...
28
29
30
31
 
32
33
34
...
58
59
60
61
 
62
63
64
...
28
29
30
 
31
32
33
34
...
58
59
60
 
61
62
63
64
0
@@ -28,7 +28,7 @@ class Admin::AssetsControllerTest < Test::Unit::TestCase
0
         process_upload ['logo.png']
0
         assert_equal 'logo.png', assigns(:assets).first.title
0
         assert_match /logo\.png/, flash[:notice]
0
- assert_redirected_to asset_path
0
+ assert_redirected_to assets_path
0
       end
0
     end
0
   end
0
@@ -58,7 +58,7 @@ class Admin::AssetsControllerTest < Test::Unit::TestCase
0
       assert_difference Asset, :count, asset_count do
0
         process_upload %w(logo.png logo.png)
0
         assert_match /2 assets/, flash[:notice]
0
- assert_redirected_to asset_path
0
+ assert_redirected_to assets_path
0
       end
0
     end
0
   end
...
54
55
56
57
 
58
59
60
...
54
55
56
 
57
58
59
60
0
@@ -54,7 +54,7 @@ class FeedControllerTest < Test::Unit::TestCase
0
 end
0
 
0
 context "About Section Feed" do
0
- fixtures :contents, :sections, :assigned_sections, :sites
0
+ fixtures :contents, :sections, :assigned_sections, :sites, :users, :assets, :assigned_assets
0
   def setup
0
     @controller = FeedController.new
0
     @request = ActionController::TestRequest.new

Comments

    No one has commented yet.