Depending on which page is being viewed, I want to use a different image for my logo; logo on the main page more. I like to use query specifications to test behavior, so I would like to do something like this:
describe 'Visit "advertentie/1"' do
it 'contains add details' do
add = create(:add_with_photos)
visit add_path add
page.should have_selector( 'img[alt="logo-small"]' )
page.should have_content( add.name )
end
end
and the test starts some kind of haml-generated html again:
<div class='logo-wrapper'>
<h1>
<a href="/"><img alt="Logo-big" src="/assets/logo-small.png" />
<br>
<span>UpMarket</span>
</a>
</h1>
</div>
however, this selector does not work. Is this possible and how?
source
share