Why does assert_select not accept 4.2 rail parameters?

I am working on rails integration checks, someone wrote tests that passed at that time, but now they warn

here is a line of code i was working on

assert_select "a[href=/monster_xml_users/#{user_xml.id}][data-method=delete]", I18n.t('revoke_access')

But now he warns

Invalid CSS selector, statement fails

But if I write it as an alternative, like this

 assert_select "a", I18n.t('revoke_access')
        assert_select "a" do
          assert_select "[href=?]","/monster_xml_users/#{user_xml.id}"
          assert_select "[data-method=?]", "delete"
        end

Then it does not give any warnings and tests pass, and rightly so. But I can’t understand why the previous statement is failing now? Does assert_select syntax now change in Rails 4.2?

+4
source share
1 answer

. css, .

assert_select "a[href='/monster_xml_users/#{user_xml.id}'][data-method='delete']", I18n.t('revoke_access')
+5

All Articles