Commit 7635668eab2c54e868d6e2f0b6b4b73518e61cf4
1 parent
a66293bb
Exists in
master
and in
23 other branches
routes: avoid test failure due to unexpected param profile
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
lib/noosfero/plugin/routes.rb
| @@ -15,8 +15,11 @@ Dir.glob(File.join(Rails.root, plugins_root, '*', 'controllers')) do |controller | @@ -15,8 +15,11 @@ Dir.glob(File.join(Rails.root, plugins_root, '*', 'controllers')) do |controller | ||
| 15 | controllers_by_folder.each do |folder, controllers| | 15 | controllers_by_folder.each do |folder, controllers| |
| 16 | controllers.each do |controller| | 16 | controllers.each do |controller| |
| 17 | controller_name = controller.gsub("#{plugin_name}_plugin_",'') | 17 | controller_name = controller.gsub("#{plugin_name}_plugin_",'') |
| 18 | - map.connect "#{prefixes_by_folder[folder]}/#{plugin_name}/#{controller_name}/:action/:id", :controller => controller, | ||
| 19 | - :profile => (if %w[profile myprofile].include?(folder) then /#{Noosfero.identifier_format}/ else nil end) | 18 | + if %w[profile myprofile].include?(folder) |
| 19 | + map.connect "#{prefixes_by_folder[folder]}/#{plugin_name}/#{controller_name}/:action/:id", :controller => controller, :profile => /#{Noosfero.identifier_format}/ | ||
| 20 | + else | ||
| 21 | + map.connect "#{prefixes_by_folder[folder]}/#{plugin_name}/#{controller_name}/:action/:id", :controller => controller | ||
| 22 | + end | ||
| 20 | end | 23 | end |
| 21 | end | 24 | end |
| 22 | 25 |