2014-05-16 18:03:13 -04:00
|
|
|
require 'test_helper'
|
2007-03-30 04:36:52 +00:00
|
|
|
|
2009-06-02 21:22:50 +02:00
|
|
|
class FeedlistControllerTest < ActionController::TestCase
|
2007-03-30 04:36:52 +00:00
|
|
|
|
|
|
|
def test_get_index_when_not_logged_in
|
|
|
|
get :index
|
2012-04-24 20:47:07 +02:00
|
|
|
assert_redirected_to login_path
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def test_get_index_by_logged_in_user
|
2007-10-09 05:17:28 +00:00
|
|
|
login_as :other_user
|
2007-03-30 04:36:52 +00:00
|
|
|
get :index
|
|
|
|
assert_response :success
|
2012-04-24 20:47:07 +02:00
|
|
|
assert_equal "TRACKS::Feeds", assigns['page_title']
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|
2012-05-03 23:23:31 +02:00
|
|
|
|
|
|
|
def test_get_feeds_for_context_using_xhr
|
|
|
|
login_as(:admin_user)
|
|
|
|
xhr :get, :get_feeds_for_context, :context_id => contexts(:errand).id
|
|
|
|
assert_response 200
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_get_feeds_for_project_using_xhr
|
|
|
|
login_as(:admin_user)
|
|
|
|
xhr :get, :get_feeds_for_project, :project_id => projects(:timemachine).id
|
|
|
|
assert_response 200
|
|
|
|
end
|
2007-03-30 04:36:52 +00:00
|
|
|
|
2012-04-24 20:47:07 +02:00
|
|
|
end
|