newUser
newUser

Reputation: 701

Cucumber & Capybara: Should use rendered.should, page.should or response.should?

Which of the following should I be using for cucumber features that employ capybara?:

rendered.should have_selector
page.should have_selector
response.should have_selector

I can't seem to get any of them to work - I receive a different error message for each

Upvotes: 3

Views: 2581

Answers (2)

Jo Liss
Jo Liss

Reputation: 33084

The correct way is page.should have_selector. Take a look at the README, section "Querying", for more documentation.

(There is no method called rendered (that I know of), and response exists in Capybara::Driver::RackTest, but I'm not sure how one might use it -- I've never needed it.)

Upvotes: 4

newUser
newUser

Reputation: 701

After some tricky google code searching, the answer seems to be

response.should have_selector

Upvotes: 0

Related Questions