Question

I am often at a loss when trying to debug, since RSpec only tells me that

expected redirect to "/user_session/new", got no redirect
expected success? to return true, got false.

but since It doesnt tell me what happened instead its hard to debug,

so is this something built in to RSpec and cannot be changed or is it a configuration thing of some kind.

Was it helpful?

Solution

Test frameworks generally permit you to assert that an actual result is equal to an expected result, and when that assertion fails, will print out the assertion as well as the expected and actual results.

There's not much more they can do. What you seem to be looking for is magical intuition on the part of software.

Try something like:

response.status_code.should == 200

This compares the actual status_code with the expected status_code, asserting their equality, and printing both if the assertion fails.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top