mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-28 12:58:48 +01:00
Update assert_select for Nokogiri compatibility
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
This commit is contained in:
parent
d7d86446c0
commit
689db4c9c3
9 changed files with 66 additions and 64 deletions
|
|
@ -69,16 +69,17 @@ class UsersXmlApiTest < ActionDispatch::IntegrationTest
|
|||
def test_get_users_as_xml
|
||||
get '/users.xml', {}, basic_auth_headers()
|
||||
assert_response :success
|
||||
assert_tag :tag => "users",
|
||||
:children => { :count => 4, :only => { :tag => "user" } }
|
||||
assert_no_tag :tag => "password"
|
||||
assert_select 'users' do
|
||||
assert_select 'user', count: 4
|
||||
end
|
||||
assert_select 'password', false
|
||||
end
|
||||
|
||||
def test_get_user_as_xml
|
||||
get "/users/#{users(:other_user).id}.xml", {}, basic_auth_headers()
|
||||
assert_response :success
|
||||
assert_tag :tag => "user"
|
||||
assert_no_tag :tag => "password"
|
||||
assert_select 'user'
|
||||
assert_select 'password', false
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue