Commit 4dae12071a2c2210b0fe919eb6dce65d460a0de4

Authored by Joenio Costa
1 parent 367d38e3

Only match numbers for the 'id' param in the embed route

also, add at least one test

(ActionItem3031)
config/routes.rb
... ... @@ -32,7 +32,7 @@ ActionController::Routing::Routes.draw do |map|
32 32 map.connect 'user_themes/*stuff', :controller => 'not_found', :action => 'nothing'
33 33  
34 34 # embed controller
35   - map.embed_block 'embed/block/:id', :controller => 'embed', :action => 'index', :id => /.+/
  35 + map.embed_block 'embed/block/:id', :controller => 'embed', :action => 'index', :id => /\d+/
36 36  
37 37 # online documentation
38 38 map.doc 'doc', :controller => 'doc', :action => 'index'
... ...
test/integration/routing_test.rb
... ... @@ -270,5 +270,8 @@ class RoutingTest < ActionController::IntegrationTest
270 270 assert_routing('/work/free-software/versions', :controller => 'content_viewer', :action => 'article_versions', :page => [ 'work', 'free-software'] )
271 271 end
272 272  
  273 + should 'have route to get HTML code of Blocks to embed' do
  274 + assert_routing('/embed/block/12345', :controller => 'embed', :action => 'index', :id => '12345')
  275 + end
273 276  
274 277 end
... ...