Commit c95d491c9545c64163088259fd6310fc9b5204d1
1 parent
8383b80f
Exists in
master
and in
29 other branches
ActionItem152: adding controller for /profile/*/*
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1252 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
28 additions
and
0 deletions
Show diff stats
config/routes.rb
... | ... | @@ -43,6 +43,9 @@ ActionController::Routing::Routes.draw do |map| |
43 | 43 | # controllers for blocks |
44 | 44 | map.controllers 'block/:profile/:controller/:action/:id', :controller => Noosfero.pattern_for_controllers_from_design_blocks |
45 | 45 | |
46 | + # public profile information | |
47 | + map.profile 'profile/:profile/:action', :controller => 'profile', :action => 'index' | |
48 | + | |
46 | 49 | ###################################################### |
47 | 50 | ## Controllers that are profile-specific (for profile admins ) |
48 | 51 | ###################################################### | ... | ... |
... | ... | @@ -0,0 +1,18 @@ |
1 | +require File.dirname(__FILE__) + '/../test_helper' | |
2 | +require 'profile_controller' | |
3 | + | |
4 | +# Re-raise errors caught by the controller. | |
5 | +class ProfileController; def rescue_action(e) raise e end; end | |
6 | + | |
7 | +class ProfileControllerTest < Test::Unit::TestCase | |
8 | + def setup | |
9 | + @controller = ProfileController.new | |
10 | + @request = ActionController::TestRequest.new | |
11 | + @response = ActionController::TestResponse.new | |
12 | + end | |
13 | + | |
14 | + # Replace this with your real tests. | |
15 | + def test_truth | |
16 | + assert true | |
17 | + end | |
18 | +end | ... | ... |
test/integration/routing_test.rb
... | ... | @@ -93,4 +93,9 @@ class RoutingTest < ActionController::IntegrationTest |
93 | 93 | assert_routing('/tag/umboraminhaporra', :controller => 'search', :action => 'tag', :tag => 'umboraminhaporra') |
94 | 94 | end |
95 | 95 | |
96 | + def test_profile_routing | |
97 | + assert_routing('/profile/ze', :controller => 'profile', :profile => 'ze', :action => 'index') | |
98 | + assert_routing('/profile/ze/friends', :controller => 'profile', :profile => 'ze', :action => 'friends') | |
99 | + end | |
100 | + | |
96 | 101 | end | ... | ... |