tracks/test/controllers/feedlist_controller_test.rb
Matt Rogers 2f85a42f91
Use the keyword args syntax for controller actions
Co-Authored-By: Dan Rice <dnrce@users.noreply.github.com>
2018-11-03 15:02:00 -05:00

29 lines
754 B
Ruby

require 'test_helper'
class FeedlistControllerTest < ActionController::TestCase
def test_get_index_when_not_logged_in
get :index
assert_redirected_to login_path
end
def test_get_index_by_logged_in_user
login_as :other_user
get :index
assert_response :success
assert_equal "TRACKS::Feeds", assigns['page_title']
end
def test_get_feeds_for_context_using_xhr
login_as(:admin_user)
get :get_feeds_for_context, xhr: true, params: { :context_id => contexts(:errand).id }
assert_response 200
end
def test_get_feeds_for_project_using_xhr
login_as(:admin_user)
get :get_feeds_for_project, xhr: true, params: { :project_id => projects(:timemachine).id }
assert_response 200
end
end