In assert_select, you can also use a question mark for the attribute value, and then follow with a string to match.
assert_select "a[href=?]", "https://stackoverflow.com/desired_path/1"
There’s another way to use assert_select that is more friendly, especially if you want to match a partial string or regexp pattern:
assert_select "a", :href => /acebook\.com\/share/