Tag Archives: assert_select
Using assert_select to find an attribute that has square brackets in the value
Problem: assert_select ‘input[name=model_name[field_name]]’ gives ArgumentError: Invalid selector: ] Solution: assert_select ‘input[name=?]‘, ‘model_name[field_name]‘ Thanks to the Boston Ruby Group thread for the answer. Bonus: Here’s a helpful assert_select cheat sheet.