ruby on rails - How to test for flash using cucumber -


i writing cucumber tests ror app , need test flash appear:

<p class='flashnotice flash'>message sent.</p> 

however, can't find solution works. i've tried:

  page.should have_selector('p', :class => 'flashnotice flash')     page.should have_content fartknocker   end 

but returns error on :class , says can't use that. can show me right way test flash?

you can use style instead

page.should have_css('.flashnotice', text: "message sent") 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -