ruby on rails - Capybara: Unable to find css again -


page source (from save_and_open_page):

<a class="btn btn-mini btn-danger" data-confirm="are sure?" data-method="delete" href="/slides/1" rel="nofollow">delete</a> 

spec/features/slides_spec.rb:

scenario "delete slide"     visit album_slides_url slide.album     # save_and_open_page     expect{page.find('btn btn-mini btn-danger').click}.to change(slide, :count).by(-1)   end 

error:

unable find css "btn btn-mini btn-danger" 

there few q&a similar issue didn't find solution there. ideas ?

in css selectors classes identified starting dots, easy forget. also, if want find element has of classes specified can't have whitespace in between them; otherwise looking children.

page.find('.btn.btn-mini.btn-danger') 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -