Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Build a Simple Ruby on Rails Application
Testing Responses: Challenge 1 of 1
Add an assertion to make sure the response was successful
Stone Preston42,016 Points
can you post a link to the challenge? i cant give you a definite answer without seeing it myself but the Rails Testing Guide lists some of the assertions that come with mini test, one of them being
Asserts that the response comes with a specific status code. You can specify :success to indicate 200-299, :redirect to indicate 300-399, :missing to indicate 404, or :error to match the 500-599 range. You can also pass an explicit status number or its symbolic equivalent.
so to assert that the response was successful you would use: