Commit 1089c991b4facad6448cb511b3283d4319b6744e
1 parent
b06e3c40
Exists in
master
and in
29 other branches
ActionItem48: unifying the search routes and removing unused design_blocks route
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1611 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
2 additions
and
11 deletions
Show diff stats
config/routes.rb
| ... | ... | @@ -31,16 +31,12 @@ ActionController::Routing::Routes.draw do |map| |
| 31 | 31 | map.tag 'tag/:tag', :controller => 'search', :action => 'tag' |
| 32 | 32 | |
| 33 | 33 | # search |
| 34 | - map.connect 'search/filter/*category_path', :controller => 'search', :action => 'filter' | |
| 35 | - map.connect 'search/:action', :controller => 'search' | |
| 34 | + map.connect 'search/:action/*category_path', :controller => 'search' | |
| 36 | 35 | |
| 37 | 36 | # categories controller |
| 38 | 37 | map.connect 'cat', :controller => 'category', :action => 'index' |
| 39 | 38 | map.category 'cat/*category_path', :controller => 'category', :action => 'view' |
| 40 | 39 | |
| 41 | - # controllers for blocks | |
| 42 | - map.controllers 'block/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_from_design_blocks | |
| 43 | - | |
| 44 | 40 | # public profile information |
| 45 | 41 | map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index' |
| 46 | 42 | ... | ... |
test/integration/routing_test.rb
| ... | ... | @@ -92,7 +92,7 @@ class RoutingTest < ActionController::IntegrationTest |
| 92 | 92 | end |
| 93 | 93 | |
| 94 | 94 | def test_search_routing |
| 95 | - assert_routing('/search', :controller => 'search', :action => 'index') | |
| 95 | + assert_routing('/search', :controller => 'search', :action => 'index', :category_path => []) | |
| 96 | 96 | end |
| 97 | 97 | |
| 98 | 98 | def test_search_filter_routing | ... | ... |
test/unit/noosfero_test.rb
| ... | ... | @@ -18,11 +18,6 @@ class NoosferoTest < Test::Unit::TestCase |
| 18 | 18 | assert_equal(//, Noosfero.pattern_for_controllers_in_directory('lala')) |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | - should 'support controllers from design_blocks directory' do | |
| 22 | - Dir.expects(:glob).with("#{RAILS_ROOT}/app/design_blocks/*/controllers/*_controller.rb").returns(['app/design_blocks/block1/controllers/block1_controller.rb', 'app/design_blocks/block2/controllers/block2_controller.rb']) | |
| 23 | - assert_equal(/(block1|block2)/, Noosfero.pattern_for_controllers_from_design_blocks) | |
| 24 | - end | |
| 25 | - | |
| 26 | 21 | should 'support setting default locale' do |
| 27 | 22 | Noosfero.default_locale = 'pt_BR' |
| 28 | 23 | assert_equal 'pt_BR', Noosfero.default_locale | ... | ... |