mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
assert_select has been moved into the rails-dom-testing gem and is now based on Nokogiri. * Remove assert_tag and assert_xml_select * Quote CSS attribute selector values * Use decoded versions of HTML in assert_select. Nokogiri decodes elements prior to matching. * Add a test helper for entities such as ` ` for which it's difficult or confusing to include the decoded version directly in the assertion. * Assert directly on Atom feeds' XML namespace because it isn't selectable as an attribute
29 lines
720 B
Ruby
29 lines
720 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)
|
|
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
|
|
|
|
end
|