User authentication unit test?
John Fiala
5 posts
|
Hey. I’m looking at page 186 of the latest version, and it’s telling me I should write a test for test_should_authenticate_user. I did my best, but looking at the tests in the final version, it looks like you’re expecting me to use User.authenticate – but by this point in the book we haven’t gone over adding the authenticate method – that seems to be on page… 199, it seems. BTW: Really enjoying this book. Oh! And when I go into my tests, they say they’re ActiveSupport::TestCase, not Test::Unit::TestCase – but they work the same way so far, so that’s not a big thing for me. John |
John Fiala
5 posts
|
Here’s another odd bit in the User part of the user_group app. In the initial listing for the UserController on page 179/180, you include the find_user code and the before_filter statement… and then later on 187 in the text you explain how you need to add that code to the class. |
Derek DeVries
8 posts
|
John, We’re glad you’re enjoying the book! You’re right, it seems we jumped ahead with authentication test. We’ll have to fix that. ActiveSupport::TestCase was recently added to Rails 2.0, and as you’ve seen it doesn’t affect the functionality of the tests shown in the book. We’ll hopefully have these examples updated for the next version. The second issue you mention is because we meant to show only a section of the users controller on page 179/180, and not the entire controller. That was a mistake on our part, and we’ll have to fix this code example. Thanks for your feedback! We’ll do our best to address these for the next version. If you find any more errata, feel free to submit them to our errata page for the book. |
John Fiala
5 posts
|
How do I submit them to the page? I went to the link you provided, and although I see a lot of errata I can read, I don’t see anyway to add information? |
Derek DeVries
8 posts
|
At the top of that page there is a link to submit it |
5 posts, 2 voices
