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

Eclipse formatter for java ending braces -

ruby - Nesting modules inside of a Rails eninge gem -

java - Are there any classes that implement javax.persistence.Parameter<T>? -