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,7 +32,7 @@ ActionController::Routing::Routes.draw do |map|
32 map.connect 'user_themes/*stuff', :controller => 'not_found', :action => 'nothing' 32 map.connect 'user_themes/*stuff', :controller => 'not_found', :action => 'nothing'
33 33
34 # embed controller 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 # online documentation 37 # online documentation
38 map.doc 'doc', :controller => 'doc', :action => 'index' 38 map.doc 'doc', :controller => 'doc', :action => 'index'
test/integration/routing_test.rb
@@ -270,5 +270,8 @@ class RoutingTest < ActionController::IntegrationTest @@ -270,5 +270,8 @@ class RoutingTest < ActionController::IntegrationTest
270 assert_routing('/work/free-software/versions', :controller => 'content_viewer', :action => 'article_versions', :page => [ 'work', 'free-software'] ) 270 assert_routing('/work/free-software/versions', :controller => 'content_viewer', :action => 'article_versions', :page => [ 'work', 'free-software'] )
271 end 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 end 277 end