This seems like it should be real easy to do but I have not found any documentation:
I have an image tag in a page:
<%= image_tag “arrow_green.gif”, :alt => “image did not load” %>
And a functional test I would like to write:
assert_tag :tag => “img”, :attributes => { :src => “arrow_green.gif” }
Of course, rails return the asset id at the end, so the test fails:
expected tag, but no tag found matching {:tag=>“img”, :attributes=>{:src=>“arrow_green.giv”}} in…
So is there a way to write a test for this? I know I can use an :alt property and test that, but I really would rather test the :src. Any way to get the asset id within the test so I could write:
assert_tag :tag => “img”, :attributes => { :src => “arrow_green.gif” + asset_id }