The projects controller gets more RESTy. It now supports XML, RSS, ATOM, HTML and plain text views of the projects list.

Changes include:

 * Add assert_xml_select method for testing RSS and ATOM results (Thanks, Jamis! http://weblog.jamisbuck.org/2007/1/4/assert_xml_select)
 * Add resource_feeder plugin for generating RSS and ATOM feeds
 * Update the URL on the Feeds page to use /projects.rss or /projects.txt instead of FeedController link
 * Add created_at and updated_at timestamps to project table to support ATOM feeds
 * Added new filter to login_system "login_or_feed_token_required" to allow RSS, ATOM or text requests with token-based authentication 
 
Notes:
 * This will break previous project listing feed subscriptions.
 * RSS, ATOM & text feeds are available via session or HTTP_BASIC authentication, or by passing the user's token on the url; HTML and XML results are only available via session or HTTP_BASIC authentication
 


git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@415 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-02-01 05:32:05 +00:00
parent fda7788237
commit d9d5ff4d06
35 changed files with 735 additions and 94 deletions

View file

@ -0,0 +1,30 @@
require File.dirname(__FILE__) + '/../test_helper'
require 'feedlist_controller'
# Re-raise errors caught by the controller.
class FeedlistController; def rescue_action(e) raise e end; end
class FeedlistControllerTest < Test::Unit::TestCase
fixtures :users, :preferences, :projects, :contexts, :todos, :notes
def setup
assert_equal "test", ENV['RAILS_ENV']
assert_equal "change-me", Tracks::Config.salt
@controller = FeedlistController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
def test_get_index_when_not_logged_in
get :index
assert_redirected_to :controller => 'login', :action => 'login'
end
def test_get_index_by_logged_in_user
@request.session['user_id'] = users(:other_user).id
get :index
assert_response :success
assert_equal "TRACKS::Feeds", assigns['page_title']
end
end