diff options
author | Marius Mathiesen <marius@shortcut.no> | 2009-12-17 14:25:41 +0100 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2010-01-12 10:10:09 +0100 |
commit | c1a109d3493e3739906c28824b5881661ed60278 (patch) | |
tree | d8e26e9deaab388ef331c18173f15ef2e26370b7 | |
parent | dc2eddb451b25b9d9b5987d686e6ed93f6edcff9 (diff) | |
download | gitorious-mainline-outdated-c1a109d3493e3739906c28824b5881661ed60278.zip gitorious-mainline-outdated-c1a109d3493e3739906c28824b5881661ed60278.tar.gz gitorious-mainline-outdated-c1a109d3493e3739906c28824b5881661ed60278.tar.bz2 |
Introducing Site#public_timeline as /activity
The global activity stream is now available for logged in users too
-rw-r--r-- | app/controllers/site_controller.rb | 9 | ||||
-rw-r--r-- | config/routes.rb | 2 | ||||
-rw-r--r-- | lib/gitorious/reservations.rb | 2 | ||||
-rw-r--r-- | test/functional/site_controller_test.rb | 15 |
4 files changed, 23 insertions, 5 deletions
diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index d1cbca3..b6e2943 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -33,6 +33,11 @@ class SiteController < ApplicationController render_global_index end end + + def public_timeline + render_public_timeline + end + def dashboard redirect_to current_user @@ -89,10 +94,6 @@ class SiteController < ApplicationController render :layout => "second_generation/application", :inline => "" end - - def public_timeline - render_public_timeline - end # Render the global index template def render_global_index diff --git a/config/routes.rb b/config/routes.rb index 59640f4..f7d01d3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -173,6 +173,8 @@ ActionController::Routing::Routes.draw do |map| end map.resources :favorites + + map.activity "/activity", :controller => "site", :action => "public_timeline" map.merge_request_landing_page '/merge_request_landing_page', :controller => 'merge_requests', :action => 'oauth_return' diff --git a/lib/gitorious/reservations.rb b/lib/gitorious/reservations.rb index 7395112..f69b86c 100644 --- a/lib/gitorious/reservations.rb +++ b/lib/gitorious/reservations.rb @@ -21,7 +21,7 @@ module Gitorious def unaccounted_root_names [ "teams", "dashboard", "about", "login", "logout", "commit", "commits", "tree", "archive-tarball", "archive-zip", "contact", - "register", "signup", "blog", "merge_request_landing_page" ] + "register", "signup", "blog", "merge_request_landing_page", "activity" ] end def reserved_root_names diff --git a/test/functional/site_controller_test.rb b/test/functional/site_controller_test.rb index 38e47ed..ad30fbe 100644 --- a/test/functional/site_controller_test.rb +++ b/test/functional/site_controller_test.rb @@ -35,6 +35,21 @@ class SiteControllerTest < ActionController::TestCase GitoriousConfig[key] = old_value end end + + context "#activity" do + should "route /activity to public_timeline" do + assert_recognizes({ + :controller => "site", + :action => "public_timeline" + }, "/activity") + end + + should "render the global activity timeline" do + get :public_timeline + assert_response :success + assert_template "site/index" + end + end context "#index" do |