Deprecation messages are not helpful
rafaelfranca opened this issue · 2 comments
rafaelfranca commented
They are pointing to internal methods instead of the real call place.
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected ' ' after '[:equal, "campo"]' (called from rescue in catch_invalid_selector at /opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/rails-dom-testing-1.0.2/lib/rails/dom/testing/assertions/selector_assertions.rb:285)
GBH commented
In current Rails 4.2 I'm getting this helpful message:
DEPRECATION WARNING: The assertion was not run because of an invalid css selector.
unexpected '/' after 'equal' (called from test_get_new at /Users/oleg/Code/comfortable-mexican-sofa/test/controllers/comfy/admin/cms/layouts_controller_test.rb:26)
line 26:
assert_select "form[action=/admin/sites/#{site.id}/layouts]"
No warnings in 4.0 and 4.1.
Edit: NVM
I guess my assertion selector is bad. Should be:
assert_select "form[action='/admin/sites/#{site.id}/layouts']"
kaspth commented
@GBH Glad you worked it out. Please check out the 4.2 release notes, where we've got this change documented: http://edgeguides.rubyonrails.org/4_2_release_notes.html#assert-select.