rspec check presence custom link href into head

303 Views Asked by At

I need check presence custom link into head tag. i found many examples where need to set some text to link tag such as

should have_link('Settings', href: edit_user_path(user))

but i need check only attr href exists

my code:

it 'custom href presence to head tag' do
  within('head') do
    link = page.find(:xpath, "//link[@href='#{my_custom_url}']")
    ...
  end
end

but i see error Capybara::ElementNotFound:Unable to find css "head"

How i can implement this?

0

There are 0 best solutions below