0

I am writing cucumber tests for my RoR app and I need to test for a flash to appear:

<p class='flashnotice flash'>Message was successfully sent.</p>

However, I just can't find a solution that works. I've tried:

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

But that returns an error on :class and says I can't use that. Can someone show me the right way to test for flash?

4

1 回答 1

1

您可以改用此样式

page.should have_css('.flashnotice', text: "Message was successfully sent")
于 2013-05-03T02:49:35.827 回答