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 !
added generic route ahead of asset named routes to pass routing tests

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@1311 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sat Jul 08 11:18:46 -0700 2006
commit  312d9b6749559148cd0a9e8aea1a94ddb5e04c46
tree    df2af6f6142fae3f02e77bc1445117bbfedc0e7b
parent  b5017e05214b345cd1498778a57f2d0eb48e1d3a
...
2
3
4
 
5
6
7
...
11
12
13
14
15
 
16
17
18
...
2
3
4
5
6
7
8
...
12
13
14
 
 
15
16
17
18
0
@@ -2,6 +2,7 @@ ActionController::Routing::Routes.draw do |map|
0
   map.feed 'feed/*sections', :controller => 'feed', :action => 'feed'
0
 
0
   map.with_options :controller => 'assets', :action => 'show' do |m|
0
+ m.connect ':dir/*path', :dir => /stylesheets|javascripts|images/
0
     m.css 'stylesheets/*path', :dir => 'stylesheets'
0
     m.js 'javascripts/*path', :dir => 'javascripts'
0
     m.images 'images/*path', :dir => 'images'
0
@@ -11,8 +12,7 @@ ActionController::Routing::Routes.draw do |map|
0
   
0
   map.admin 'admin', :controller => 'admin/overview', :action => 'index'
0
   
0
- map.connect ':controller/:action/:id/:version', :version => nil,
0
- :controller => /account|(admin\/\w+)/
0
+ map.connect ':controller/:action/:id/:version', :version => nil, :controller => /routing_navigator|account|(admin\/\w+)/
0
   
0
   map.comment ':year/:month/:day/:permalink/comment', :controller => 'comments', :action => 'create',
0
       :year => /\d{4}/, :month => /\d{1,2}/, :day => /\d{1,2}/
...
14
15
16
17
18
19
20
21
22
23
 
 
 
24
25
26
...
14
15
16
 
 
 
 
 
 
 
17
18
19
20
21
22
0
@@ -14,13 +14,9 @@ class AssetsControllerTest < Test::Unit::TestCase
0
   end
0
 
0
   def test_routing
0
- with_options :controller => 'assets', :action => 'show' do |test|
0
- test.assert_routing 'stylesheets/foo/bar', :dir => 'stylesheets', :path => ['foo', 'bar']
0
- test.assert_routing 'stylesheets/foo.css', :dir => 'stylesheets', :path => ['foo.css']
0
- test.assert_routing 'images/foo/bar', :dir => 'images', :path => ['foo', 'bar']
0
- test.assert_routing 'images/foo.png' , :dir => 'images', :path => ['foo.png']
0
- test.assert_routing 'javascripts/foo/bar', :dir => 'javascripts', :path => ['foo', 'bar']
0
- test.assert_routing 'javascripts/foo.js' , :dir => 'javascripts', :path => ['foo.js']
0
+ {:stylesheets => :css, :images => :png, :javascripts => :js}.each do |dir, ext|
0
+ assert_routing "#{dir}/foo/bar", :controller => 'assets', :action => 'show', :dir => dir.to_s, :path => %w(foo bar)
0
+ assert_routing "#{dir}/foo.#{ext}", :controller => 'assets', :action => 'show', :dir => dir.to_s, :path => ["foo.#{ext}"]
0
     end
0
   end
0
 

Comments

    No one has commented yet.