Search code examples
ruby-on-railsrubytwitter-bootstraptooltipcapybara

Twitter bootstrap tooltip and Capybara


I'm running capybara and I keep getting this error bellow

✔  When I visit the agreement templates page 
!  And I follow "New Agreement Template"
~  And I fill out and submit the form                
~  Then I should see the new agreement template      
~  And I should be on the agreement template         

no link with title, id or text 'New Agreement Template' found

At the page tooltip has changed the "title" to "data-original-title" so the test can't find the "New Agreement Template".

I tried to change my test from

click_link('New Agreement Template')

to

find('#new-agreement').click_link('New Agreement Template')

adding the new-agreement as an ID but I still have the same problem


Solution

  • Try specifying id of link in click_link method or try using something like find('#new-agreement').click