Marrento
Marrento

Reputation: 329

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

Upvotes: 1

Views: 919

Answers (2)

lavaturtle
lavaturtle

Reputation: 2681

You could also try find('a[data-original-title="New Agreement Template"]').click. (This worked for me in a similar situation.)

Upvotes: 0

Shamir K.
Shamir K.

Reputation: 395

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

Upvotes: 2

Related Questions