By Developers, For Developers
| PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
|---|---|---|---|---|---|
| 11 | TYPO | Who’s Burt? ;) (4th paragraph down, next to the burrito) | 2010-04-26 | Sheesh. | |
| 14 | TYPO | 2nd line of “What is TDD good for?”, one to too many ;) | 2010-04-26 | ||
| 23 | TYPO | return line missing between assert_instance_of and assert_kind_of, just for eye candy ;) | 2010-05-16 | This is a layout issue that needs to be worked out. UPDATE -- tried something different, let me know | |
| 73 | TYPO | Colon missing in symbol name (“active”) at bottom of page: should_have_named_scope :active_only { active == true } | 2010-04-26 | ||
| 76 | SUGGEST | Sample fixture data uses @slate.com for e-mail domain name. Is it better to use a domain that will most likely never exist, to avoid having someone’s misconfigured test suite somehow spam the Washington Post-affiliated news organization? fred: first_name: Fred last_name: Flintstone email: fflint@slate.com | 2010-04-26 | Okay, it's slaterockandgravel.com | |
| 13 | TYPO | In the third paragraph, “Bert” becomes “Burt” | 2010-04-26 | ||
| 19 | TYPO | 2nd p But there are definitely cases where the cost of testing a feature like this is higher the the value of the tests. | 2010-04-26 | ||
| 20 | TYPO | A word is missing: | 2010-04-26 | Pretty sure the word is "add" | |
| 37 | SUGGEST | Unfortunately, the Appendix A is empty and the code provided on pragprog does not contain an satrting project in order to be able to follow the process. The huddle one already has the tests implemented. Moreover, it may be Rails 2.3.5 compliant. | 2010-05-11 | Yes, Appendix A was inadvertently left out of the beta, this will be corrected in the next beta. | |
| 56 | TYPO | […]although if you use RSpec you can test view partials directly directly […] There are 2 “directly” | 2010-05-04 | ||
| 17 | TYPO | Repeated words: “…feature like this is higher the the value of the tests.” I believe it should be “higher than the value of the tests.” | 2010-05-04 | ||
| 20 | TYPO | “There’s Always Some Version Confusion” breakout. Last sentence, “Test::Unit 2.0 doesn’t seem to have much of constituency at the moment” should be “much constituency” or “much of a constituency”? | 2010-05-04 | ||
| 32 | TYPO | double “the” 3. Run … encountered. If neither of those happens, the the test method passes. Yay! | 2010-05-04 | ||
| 36 | TYPO | top of page. (meaning that they can’t be arbitrary methods in the Ruby code they way they can be when calling new( ) or create( )). | 2010-05-04 | ||
| 182 | TYPO | “James Golic” is “James Golick” (ck) | 2010-05-04 | Well, that's embarrassing... | |
| 25 | TYPO | Last paragraph: - “you can multiple setup blocks or methods” is missing a word. Use? Declare? | 2010-05-04 | ||
| 29 | TYPO | In the footnote, 2nd line: - “and IDE, for example” should read “an IDE, for example” | 2010-05-04 | ||
| 211 | ERROR | Unfortunately the tests do not pass due to the “before_filter :require_user” as the generic functional tests were not updated. There may be an additional instruction there to fake a current logged in user. | 2010-05-16 | Yes, this is true, and I'm not sure what the clearest way to resolve it is. It'll be fixed one way or another in the next beta | |
| 206 | TYPO | “Inside the migration, will put …” should be “Inside the migration, we’ll put …” | 2010-05-16 | ||
| 143 | TYPO | on the second paragraph there are two “the” | 2010-05-16 | ||
| 99 | TYPO | “[…]This test is a lot more difficult to write if you don’t explicitly know the value of the the project’s start_date. But keep reading…[…]” | 2010-05-16 | ||
| 174 | TYPO | “[…]Certainly there is much less online chatter about how and when to use the the built-in integration tests[…]” | 2010-05-16 | ||
| 204 | SUGGEST | the order of the commands-events should be | 2010-05-16 | ||
| 27 | SUGGEST | You can mention the Bob Martin’s SOLID butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod that are a nice recompilation of design principles. In | 2010-07-26 | I'm not sure what this comment refers to? | |
| 41 | ERROR | “This particular fixture data was added to the project by Authlogic.” I’m afraid it wasn’t for me. I’m using Rails 2.3.5 and Authlogic 2.1.3. | 2010-05-16 | Okay, that was a mistake -- the fixture actually comes from the authlogic example http://github.com/binarylogic/authlogic_example. \n \nI clarified that in the book, but I might look for a different way to set up that test. | |
| 96 | ERROR | In the last paragraph, the descriptions for Factory.build and Factory.create methods are interchanged. It should go like this: Create and save an object: Create but don’t save: | 2010-05-16 | ||
| 204 | ERROR | I’m not sure if the issue is mine, but I’ve been through Appendix A and followed all the steps. However, when I run ‘rake’, all the tests fail: 1) Failure: … 15 tests, 13 assertions, 12 failures, 2 errors Is this expected? I have downloaded the sample code, but it is the completed version, and obviously I would prefer to go through the process of building the tests in along with the book. | 2010-06-05 | I've seen the code now: \n \nOkay, I see the problem now, I ask you to add the "before_filter :require_user" line to the application_controller.rb -- that's requiring logged in users, but the tests don't provide logged in users at first. \n \nTake that line out, and everything should be fine. See section 3.4 to show how logins need to be handled in controller tests. I'll fix the appendix for the next beta. \n | |
| 17 | TYPO | 4th paragraph: “Still, it’s useful to keep this mind as a goal, and most” I believe it should be: “Still, it’s useful to keep this goal in mind, and most” | 2010-05-21 | ||
| 92 | TYPO | FixtureReplacement, Machinist and ObjectDaddy examples printed twice | 2010-05-21 | ||
| 78 | SUGGEST | It is not obvious what the name of the YAML file in first piece of code should be. It would be nice to know if it should be users.yml or user.yml, and why. | 2010-06-05 | ||
| 80 | SUGGEST | In the description of has many relationship, it would be nice to see an example of how to set up has many attributes in a YAML file. | 2010-07-05 | ||
| 92 | TYPO | In “Creating an individual Factory”, there is duplication of the code for FixtureReplacement, Machinist and Object Daddy. | 2010-06-05 | ||
| 225 | ERROR | The “script/generate session user_session” command does not work in Rails 3 and no work around is mentioned for it in book… This entire section is very confusing as the author keeps skipping around from Rails 2 to Rails 3. There probably should be a different section for installing Authlogic with Rails 3 and one for Rails 2.3.5. | 2010-07-05 | My understanding is that there is no current workaround for generating the Authlogic session in Rails 3. \n \nThe appendix will be re-structured once all the Rails 3 pieces are in place and it's more clear how different the steps are. | |
| 28 | TYPO | What’s particularly nice about this is that—as with before filters—you can haven multiple setup blocks or methods, and they will all be exe- cuted before each test: You probably meant to write “you can have multiple setup blocks”… | 2010-06-05 | ||
| 227 | TYPO | as a call -> is a call “All the User class itself needs as a call to the acts_as_authentic( ) method.” Could be interesting to explain exactly what the acts_as_authentic( ) method does, too. | 2010-07-26 | I'll see what I can do, but I think that's kind of out of scope, also the switch to devise causes this text to be removed | |
| 37 | TYPO | Extra closing paren on page 37: If the key is an association, the value represents the name of a fixture in the related table (or a comma-separated list of fixture names for a one-to-many relationship). If we do specify an id in the YAML file, the nifty auto- association feature will not work). | 2010-06-05 | ||
| 13 | TYPO | In paragraph 4, lines 4 and 5, Bert gets misspelled Burt twice. | 2010-07-05 | ||
| 224 | ERROR | After following the instructions for the app in Appendix A, running rake gave me: All errors were of the “ActiveRecord::StatementInvalid:” type. Moseying around on the internets this is an issue that was fixed with this patch: While going through the prior reported errata I saw #43242 which recommended the removal of before_filter :require_user in application_controller.rb which I tried but this did not alter my rake output in any discernible way. I am running Ubuntu Lynx with: | 2010-07-05 | Anita told me in private email that this is a Rails error. | |
| 13 | TYPO | In footnote 5, “Bert’s” should be “Bert” instead. | 2010-07-05 | ||
| 24 | SUGGEST | The last example on the page is introduced with a paragraph ending with, “You can negate this assertion with the converse method assert_not_equal():”, but the example uses assert_equal(). That seems dissonant. Moving the example to, e.g., after the first sentence in the paragraph (“The most commonly used assertion is assert_equal()…”), might cure that dissonance. | 2010-07-05 | ||
| 24 | TYPO | The next-to-last paragraph ends with a colon, but there is now example following it. | 2010-07-26 | ||
| 245 | SUGGEST | On section A.1 Basic Rails after “Let’s start with the basics” we have the command to create the huddle example application: Running that on Rails 3, gives the usage of the command rails, as it has changed from versions 2.x. % rails new huddle | 2010-07-26 | The appendix is not fully Rails 3 compatible yet. | |
| 246 | SUGGEST | Just after the line: gem “authlogic”, :git => “git://github.com/binarylogic/authlogic.git” Don’t we need a line to describe briefly how to use bundler to install the gems, after modifiying the Gemfile? as in: bundle install | 2010-07-26 | The appendix is not fully Rails 3 compatible yet. | |
| 21 | SUGGEST | When dealing with the declarative syntax of a test it could be useful to mention that using non-ascii character in the name will cause the test not to be executed. It will just silently not run. I noticed this when testing the “saving a status report that has a date doesn’t override”, because I renamed the test in french. This might be caused by my particular setup, though : rails 3 beta 4 with Jruby. | 2010-07-26 | ||
| 47 | TYPO | The examples are dealing with reports, not tests. test “a test with both blank is not valid” should read test “a report with both blank is not valid” | 2010-07-26 | ||
| 47 | SUGGEST | could be useful to mention that in rails 3, the third test does not fail. The autogenerated test is @status_report.attributes is added, in contrary to rails2.3 | 2010-07-26 | Fixed in Rails 3 update | |
| 47 | SUGGEST | On the second line of the test “saving a status report saves the status date”, there is fix to the test by adding: actual=StatusReport.new(:today => “t”, :yesterday => “y”) Testing with Rails beta 4, the test passes without the fix, as the scaffold code has the following: post :create, :status_report => @status_report.attributes Should it be a mention about the difference? | 2010-07-26 | ||
| 49 | SUGGEST | In the validate_has_at_least_one_status method the line: errors.add_to_base(“Must have at least one status set”) when using Rails 3 should become: errors[:base] << “Must have at least one status set” | 2010-07-23 | ||
| 89 | TYPO | Missing comma in the last paragraph, between “… placing them in the ActiveRecord class” and “reopening the class by…” | 2010-07-26 | ||
| 250 | SUGGEST | In method store_location the line: session[:return_to]= request.request_uri when used in Rails 3, should be replaced with: session[:return_to] = request.fullpath | 2010-07-26 | This is authlogic boilerplate that is out of the text in beta 5 | |
| 51 | TYPO | The line: Despited not adding any new tests, … should be: Despite not adding any new tests, …. | 2010-07-26 | ||
| 52 | SUGGEST | In the line that adds the setup method login_as_ben, ie : setup :login_as_ben to be added in top of the two controller tests, projects_controller_test and status_reports_controller_test when used in Rails 3, there is already a setup method added so it should be: setup do and similarly in the projects controller test: setup do | 2010-07-26 | I actually prefer to keep them as separate setup commands. | |
| 65 | SUGGEST | Line : named_scope :by_user_name … should be: scope :by_user_name in Rails 3 | 2010-07-26 | ||
| 220 | SUGGEST | We used rcov on our previous (1st) rails project, and it was great. But when we moved to using ruby 1.9.1 along with rvm, I find I can’t run rcov in this environment. The relevance rcov site claims they are still working on 1.9.1 compatability. I think you need to write a big box about this, as other people will also get stuck. | 2010-08-11 | ||
| 42 | TYPO | There is no user defined as :ben, so either the test symbol should change or the fixtures definition on the next page( and in the appendix.) | 2010-08-11 | ||
| 57 | TYPO | In the code example there is a duplicate line of code | 2010-08-11 | ||
| 61 | ERROR | I think you’re missing trailing _id for both the user and project dom IDs. | 2010-08-11 | ||
| 67 | TYPO | instead of: use: | 2010-08-11 | ||
| 87 | TYPO | Instead of: | 2010-08-11 | ||
| 166 | TYPO | last paragraph | 2010-08-11 | ||
| 181 | TYPO | instead of: | 2010-08-11 | ||
| 33 | OK | Figure 2.2: Should it read “Initial Database preset” or “Initial Database reset”? The text describes “clearing” the database of all data on the previous page (p. 32). | 2010-09-02 | ||
| 263 | TYPO | Paragraph after “$ rails generate devise User”: This creates a user model, with tests, a database migration, and a route that references the devise engine. The fixture file created for a user is invalid – it doesn’t have any data, and the tests are going to changes. changes > change | 2010-09-02 | ||
| 25 | 25 | TYPO | …assert( ) and all the other Test::Unit assertion methods takes an optional last argument… Should read: | 2010-09-02 | |
| 50 | ERROR | Replace the validation line in app/model/status_report.rb with the following: BEGIN INSERT And write the corresponding function: END INSERT def validate_has_at_least_one_status NOTE: The current instructions direct the reader to replace the “validate_presence_of :yesterday, :today” line of code with the “def validate_has_at_least_one_status … end” function shown on the page. For anyone new to Ruby and/or Rails (and not just TDD), he won’t easily figure out that he’s missing a “validate :function_name” call, and that the function definition needs to be separate. | 2010-09-02 | ||
| 51 | TYPO | Section 3.4, after the numbered list: “In order to enforce an Devise login globally throughout the app…” an > a | 2010-09-02 | ||
| 277 | TYPO | In the following paragraph, towards the end of the page, it’s talking about Devise but it still says “to get the Authlogic gem included” — | 2010-09-02 | ||
| 21 | TYPO | Missing end-of-sentence period. Final sentence of first paragraph. “The user-facing section will cover controllers, view testing, test- ing your Rails helpers, and testing Ajax calls with Blue Ridge” | 2010-09-02 | ||
| 115 | ERROR | The “any_of(…” code is certainly tangled! I think there may be a misplaced closing parenthesis: should proj.stubs(:thing).with(any_of(instance_of(String)), actually be proj.stubs(:thing).with(any_of(instance_of(String), ? IOW, I think any_of() should contain the list of accepted instances. | 2010-09-02 | ||
| 112 | 112 | TYPO | The last para on the page starts “A related gotcha to watch out when using…” Should that be “… watch out for …” ? | 2010-09-02 | |
| 54 | TYPO | … noel = User.create!(:email => “railsprescriptions@gmail.con” … gmail.com, not gmail.con | 2010-09-02 | ||
| 263 | TYPO | In the gray box, last paragraph, second sentence: “… the kind of testing testing weight we want to put in it.” Should “testing testing” be removed? | 2010-09-02 | ||
| 252 | ERROR | original text: should be cucumber:install, not cucumber:skeleton The generators available with cucumber-rails 2.0.0.beta.20 are: Cucumber: | 2010-10-05 | ||
| 52 | TYPO | The end of the first paragraph on the page reads: “For Rails 2.x, A similar change needs to be made in test/functional/status_reports_controller_test.rb:” But there’s no code before the next paragraph begins. | 2010-10-05 | ||
| 54 | TYPO | Last paragraph on page reads: “In order to enforce an Devise login…” an > a | 2010-10-05 | ||
| 55 | TYPO | In the middle of the page, the first code snippet’s indentation is off. | 2010-10-05 | ||
| 55 | TYPO | In the middle of the page, between two code snippets, the paragraph reads: “Then, in the body of the ActiveSupport::TestCase declaration in the same file, add the following methods:” “Methods” should be singular, or a method is missing. | 2010-10-05 | ||
| 64 | TYPO | The last paragraph on the page reads: “Our first view test will just validate that the form elements actually exist in as we want them to…” Remove “in.” | 2010-10-05 | ||
| 65 | ERROR | Lines 4 and 5 refer to project_id and user_id, respectively, but Rails 3 scaffolding generated fields for project and user, not project_id and user_id. Suggested change: assert_select “#status_report_project”, :count => 0 | 2010-10-05 | ||
| 71 | ERROR | In the view code at the bottom of the page, <%= h … %> is now the default in Rails 3, so the “h” is unnecessary. Can be changed to: Yesterday I: <%= report.yesterday %> | 2010-10-05 | ||
| 85 | TYPO | Fourth line in the last paragraph on the page: “… fixtures that are available out of the box are a defined in a set of …” Remove first “a” so it reads: “… fixtures that are available out of the box are defined in a set of …” | 2010-10-05 | ||
| 214 | TYPO | “a little to far” should probably be “a little too far” (double “o” in “to”) | 2010-10-05 | ||
| 92 | SUGGEST | You may want to tell readers (especially Rails newbies) WHERE the “setup { Sham.reset }” code snippet goes inside the test_helper.rb file. I’m assuming it goes inside the ActiveSupport::TestCase class, right? | 2010-10-05 | ||
| 92 | SUGGEST | For the last code snippet on the page, what file does this go in? | 2010-10-05 | ||
| 93 | SUGGEST | Wherever there is a block of code that should be inserted into a file, tell the reader WHAT file the code belongs in and WHERE it goes in that file (e.g., inside or outside a class, before this line, after that line, etc.) If a code snippet doesn’t belong in any particular file and is for demonstration purposes only, let the reader know, or include a section at the beginning of the book that covers different conventions used throughout and what they mean. | 2010-10-05 | ||
| 97 | TYPO | Section 6.10, end of first paragraph reads: “… though at at least with factories, new tests can avoid the global data.” One too many of “at”. | 2010-10-05 | ||
| 107 | SUGGEST | In the Timecop section at the bottom of the page, the end of the first paragraph mentions putting a reference to it in the environment.rb file. If Rails 3 is what you’re referring to by default (as mentioned at the beginning of the book), then you should change this reference to Gemfile, instead. | 2010-10-05 | ||
| 117 | OK | Adding the “lets stub a class” test breaks the “should be able to retrieve projects based on day” test. The error message is as follows: <[“2009-01-06”, “2009-01-07”]> expected but was Running (with rvm 1.0.11): - ruby 1.9.2-p0 - rails 3.0.0 - factory_girl 1.3.2 Can anyone else confirm this? | 2010-10-08 | I can't reproduce this. | |
| 267 | ERROR | Don’t use the :user symbol as a parameter to the create! method. Doing this results in the error: When they have entered their account information # features/step_definitions/user_signs_up.rb:5 If you get rid of that parameter, Cucumber won’t complain anymore and move on to the next item that needs to be checked. | 2010-11-18 | ||
| 314 | TYPO | “Auotest on the Mac” should be “Autotest on the Mac” | 2010-11-18 | ||
| 23 | TYPO | The word Javascript has lost its last t and appears as “Javascrip test frameworks” | 2010-11-18 | ||
| 33 | SUGGEST | There is severe margin overlap on the filenames on this page. Also, the figure looks like it has a bounding box on the app/ filestructure. | 2010-11-23 | Overlap will be handled in typesetting | |
| 62 | TYPO | In the phrase “individually test an view partial”, “an” should be “a”. | 2010-11-18 | ||
| 31 | ERROR | Hello, I have a problem with the following section : This sentence seems to imply that rails 2 and rails 3 are different, but ends up saying that both version of rails evaluate the block in class section. Arent “setup” and “teardown” executed differently in rails 3, like the beggining of the paragraph seem to say ? Sorry if it’s just me not understanding the paragraph. Regards, | 2010-11-18 | It's a typo, the Rails 3 section should be "instance" context. | |
| 69 | SUGGEST | In app/model/status_report.rb block, while the code for the named scope works, it is the old Rails 2.3 method. The Rails 3 method might read more like this: scope :by_user_name, includes(:user).where(“user_id IS NOT NULL”).order(“users.email ASC”) | 2010-11-18 | ||
| 185 | SUGGEST | Noel, I’m currently starting a new project, and I decided to use Shoulda for the testing. But I’m half way stuck on testing a destroy controller method. The old test/unit way would be to use assert_difference, but I don’t think that will work with shoulda. So, what I would like is a an example of testing all the usual controller methods (index, new, create, edit, update, show, destroy) using shoulda tests. At the moment, I am going to do something like: | 2010-11-23 | This is out of scope for errata, please take it to the forum. | |
| 185 | SUGGEST | Noel, this may actually only be a suggestion. In the second last paragraph on this page, you say redirect_to takes any url-convertible object. Of course, I want to use the handy path and url methods setup for the controller, e.g. Sadly, because the one liner is at the class level, products_path is an undefined method. Instead, I had to change the test to: Now the test block is executed as an instance method of the controller test, and therefore it can invoke the path and url methods. Finally, I got myself one of the new Kindles, and have been reading your book on it. You’re doing a great job with the writing, and the Kindle makes it easier to read than a big heavy paper book. | 2010-11-23 | What error did you get? I think this should work, but I think I need to see the entire code snippet. Please take this to the forums. | |
| 27 | TYPO | In the second paragraph, third sentence, you say: “That’s good practice, and is enforced by the structure of Test::Unit or Rails.” Should this read “Test::Unit for Rails,” or “Test::Unit and Rails,” or something else? It’s a minor point, but I find the phrase a bit confusing. | 2010-11-18 | ||
| 317 | SUGGEST | In the Auotest on the Mac block the text says that you need to install both the ‘autotest-growl’ and ‘autotest-fsevent’ gems in order to use the OS X FSEvent library. However, I found that the ‘autotest-growl’ gem isn’t necessary for this. I have it working with only the ‘autotest-fsevent’ gem installed. | 2010-11-23 | That appears to be correct per the docs. | |
| 31 | ERROR | In the setup method the test users are assigned to local variables and are not available inside the test blocks. They should be assigned to instance variables. | 2010-11-23 | ||
| 113 | OK | “let’s stub a class” test breaks previous “should be able to retrieve projects based on day” test (p. 67) in project_test.rb. It seems like stubbing the find method of the Project class affects other tests. I went through the book from the beginning twice, now, and ran into this problem each time. | 2011-01-19 | I cannot reproduce this. Could you take this to the forum with the entire test code as you have it and with the exact error? | |
| 22 | TYPO | But there are definitely cases Should be: But there are definitely cases | 2011-01-07 | ||
| 207 | TYPO | “but any of application-specific helper modules that you plan on calling need to either be explicit” should be: “but any of the application-specific helper modules that you plan on calling need to either be explicit” | 2011-01-07 | ||
| 49 | ERROR | In the “saving a status report saves the status date” test, is there a reason that the dates must be converted to strings in the assertion? They are both Date objects. It seems that the following would be the correct test: The next paragraph then seems incomplete. “The test, of course, fails. Once again, in line 4, we’re comparing literal string objects rather than the dates.” It hints at an explanation of the string comparisons but stops short. It is possible that it is referring to the previous test (StatusRerortsControllerTest) but that wouldn’t apply since it was comparing DateTime and Date objects and thus the string conversion was necessary. | 2011-01-07 | ||
| 41 | SUGGEST | After a generic introduction to fixtures, page 41 of the PDF starts out with what looks like a link to “huddle/test/fixtures/project.yml”. It goes on to say “Add this snippet… (don’t delete the existing fixtures…”. This makes it sound like this is part of an ongoing setup of some project called “huddle”, but I believe this is the first mention of it. It’s kind of confusing… | 2011-01-07 | You are right, that paragraph came from an earlier draft where this section was after the huddle project was introduce | |
| 45 | TYPO | At the bottom of the page, there is a missing word in: “Shoulda and Contexts, on page 171 and Chapter 12, Rspec, on page 187 and .” | 2011-01-07 | ||
| 49 | TYPO | Should the footnote read, “more readable error messages THAN when the values are both dates”? | 2011-01-07 | ||
| 198 | TYPO | “Fair warning, though — there a definitely Ruby”… should be “there ARE definitely…” Whoops, incorrect “.should” syntax :-) | 2011-01-07 | ||
| 200 | TYPO | “In the line 3, the block is effectively…” Shouldn’t that start out just “In line 3,…”? | 2011-01-07 | ||
| 202 | TYPO | Should “And similarly, for users:” be “And similarly, for status reports:”? | 2011-01-07 | ||
| 203 | TYPO | The text has, “Project.stub!(:find).and_return(mock_project)”. However, on page 196, it says that in RSpec2, the method convention is to use “stub” (no exclamation point). | 2011-01-07 | ||
| 207 | TYPO | “key/value pairs, as in have_selector(have_selector(”form“, …” I think there is an extra “have_selector(” in there. | 2011-01-07 | ||
| 213 | TYPO | “expected = Ingreditent.new(hash” — there is only one “t” in “Ingredient”. | 2011-01-07 | ||
| 168 | TYPO | Line at the top of the page, “save_fixture(response.body…” has an extra close paren. | 2011-01-07 | ||
| 90 | TYPO | “Inside that block, factories can be declared do define default data.” Lovely alliteration :-) but I think you want “be declared TO define default data.” | 2011-01-07 | ||
| 91 | TYPO | The line ‘test “machinist url” do’ perhaps shouldn’t used “machinist”, since you’ve switched to factory_girl? | 2011-01-07 | ||
| 40 | OK | the line | 2011-01-07 | That is not a feature that I want to encourage or even acknowledge | |
| 323 | TYPO | Under the section “A.2 Devise,” first paragraph, second sentence: “chose” should be “choose.” | 2011-01-07 | ||
| 0 | SUGGEST | Highlighting the changed lines (added, modified, and maybe removed lines) of code will help follow-up faster with the code. | |||
| 71 | TYPO | show.html.erb tags indentation | 2011-01-07 | ||
| 40 | TYPO | …less commonly used and the tools that are used instead… | 2011-01-07 | ||
| 71 | SUGGEST | show.html.erb has lists the users for each project. However, if you go through the book sequentially, this doesn’t work. The following needs to be removed as it is not in the downloaded code either: Users for <%= | |||
|
<%= user.login %> |
<%= user.email %> |
Otherwise, the following errors keep coming up:
1) Error:
test_index_should_display_project_timeline(ProjectsControllerTest):
ActionView::Template::Error: undefined method `users’ for #
app/views/projects/show.html.erb:5:in `_app_views_projects_show_html_erb__1178292322_2175232780_0’
app/controllers/projects_controller.rb:19:in `show’
/test/functional/projects_controller_test.rb:63:in `test_index_should_display_project_timeline’
2) Error:
test_project_timeline_index_should_be_sorted_correctly(ProjectsControllerTest):
ActionView::Template::Error: undefined method `users’ for #
app/views/projects/show.html.erb:5:in `_app_views_projects_show_html_erb__1178292322_2175232780_0’
app/controllers/projects_controller.rb:19:in `show’
/test/functional/projects_controller_test.rb:55:in `test_project_timeline_index_should_be_sorted_correctly’
3) Error:
test_should_show_project(ProjectsControllerTest):
ActionView::Template::Error: undefined method `users’ for #
app/views/projects/show.html.erb:5:in `_app_views_projects_show_html_erb__1178292322_2175232780_0’
app/controllers/projects_controller.rb:19:in `show’
/test/functional/projects_controller_test.rb:31:in `test_should_show_project’
In section 6.5, second paragraph, first sentence: “FixtureReplacment” should be “FixtureReplacement.”
Section 6.7, paragraph 2, last sentence: I think “test/factory.rb” should be “test/factories.rb.”
In the “Factories and RESTful Authentication” box, second paragraph, second sentence: “that’s a name crash” should be “that’s a name clash.”
“It cleans up third party scripts be removing…” should probably have “BY removing…” instead.
Last paragraph, line beginning “testing, and part…” The word Should seems like it ought to be Shoulda, the name of the testing framework.
I think footnote .2 ought to be marked .1 instead, since it is ( in this version of the text) the first and only footnote on the page. Not a big deal, just a minor detail.
In the final sentence on the page, “associate test directory” should be “associated test directory”.
Arguably a matter of taste, but in the first sentence of the third paragraph, “Performance tests are different than” should probably be “Performance tests are different from”.
I’d post a reference if the form didn’t block me from doing so, but “different from” gets more than 13 times the usage of “different than” in written American English.
Console output where it refers to a line of code does not correspond to that line in the source code that one downloads from PragProg.com
i.e.(see Pg. 55 in PDF)
1) Failure: test_a_test_with_today_blank_is_valid(StatusReportTest) [/test/unit/status_report_test.rb:36]:
line 36 is an empty line. i think it’s referring to line 39.
on the third paragraph there are a repetition of the word “ActionMailer”:
Shoulda defines specific one-liners for ActionController, —>ActionMailer<—,
ActionView, ActiveRecord, and —>ActionMailer<—.
Re: the Users fixture, you say:
This particular fixture set was created in Appendix A, on page 323, and it defines the data object accessed as users(:one).
I don’t find that reference on page 323 or anywhere else.
Sentence 2 on the page states that “filter methods can’t take arguments”.
They can, if you use a lambda. For example:
before_filter lambda { redirect_if_not_current_user(params[:status_report][:user_id]) }
The objects created in each of the “full name” tests use variable “u1”. The assert_equal assertions though use variable name “user.” Also, should the User method be “full_name” and not “full name”? For example, maybe the first test should be written:
test “full names” do
u1 = User.create(:first_name => “Fred”, :last_name => “Flintstone”)
assert_equal(“Fred Flintstone”, u1.full_name)
end
This applies to each of the three tests listed at the end of section 5.3.
On first line of page.
… intstance_of?()…
line #2
easer to test;
Bunder should be read Bundler
as as should read as
“Shoulda defines specific one-liners for ActionController, ActionMailer, ActionView, ActiveRecord, and ActionMailer.”
ActionMailer listed twice (ok, so it’s not a biggie ; )
At the bottom of the page, Factory.next(:name) is deprecated.
This can be written as Factory.create(:name) instead.
gem ‘zebra’ in a rails 3 application didn’t work for me and I couldn’t find it via gem search. Also Google is not helpful.
So either I’m too dump or for that matter there are some additional steps necessary.
“The assert_valid() test, which verifies that an ActiveRecord model is—wait for it—valid according to the rules of that model.”
It appears assert_valid() is deprecated now (I get NoMethodError with Rails 3.0.x, and I see lots of forum posts from people upgrading to Rails 2.3.x and having their tests break).
One person had a good idea: Reimplement it as a test helper which dumps out the error(s) so you can easily see why it didn’t validate:
def assert_valid(record)
assert record.valid?, record.errors.full_messages.join(“\
”)
end
Line 9 of the Fred-and-Barney fixture example has:
email: brubble@slaterockandgravel.com/
There is an extra trailing “/” on the end of the email address.
The string defining the :name sequence uses an underscore:
sequence :name do |n|
“Project_#{n}”
end
Since all the previous examples of project names in this section use spaces, not underscores (like “Soups Online”), and since the url method changes spaces to underlines, etc., you probably wanted the sequence for :name to use a space?
sequence :name do |n|
“Project #{n}”
end
All the previous chapters have showed how to use the tools being discussed by having you add to the Huddle project, which is a learn-by-doing style that I really like. I suggest in the next edition of the book, you consider doing this for the factories chapter — when I reached the place in this chapter that said “By default, the blueprints go in test/factories.rb” it wasn’t clear to me whether I was supposed to actually be copying the listed code into that file, and expecting it to do something in Huddle.
Project.stub(:find).return(bluebook)
should read
Project.stubs(:find).returns(bluebook)
In a factory universe, with only a couple of
object defined, that may not be a difficult constraint to live with.
s/object/objects/
bluebook = Project.make(:name => "Project Bluebook")
runway = Project.make(:name => “Project Runway”)
s/make/new/
@bluebook = Project.make(:name => “Project Bluebook”)
s/make/new/
include Devise::TestHelpers
needs to be outside “class ActionController::TestCase”, isn’t it ?
Second example cites the following:
bluebook = Project.make(:name => "Project Bluebook")
runway = Project.make(:name => “Project Runway”)
What is this ‘make’ method? Did you mean ‘new’?
On line 4, “the standard Ruby library Test:Unit” should be “Test::Unit”.
In the setup method, “project.users << fred” should read “project.users << @fred”.
Near the end of the page, an extraneous “the” in “You will find much more discussion on the why fixture data is less commonly used”.
The line
should “contain things”
is missing its “do”.
Again, the contexts are missing their “do”s.
You use `create` to frequently, in my opinion. Why use it when you don’t need to test persistence logic?
Location 2026 on Kindle (ipad), the code snippet has the line numbers displaying as ugly black blocks. The PDF version of this is fine.
seventy-eleven?
Factory is no longer available. Factory.next is now FactoryGirl.generate. See github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md
is blocked or diverted. s/is/are/
Missing “with”? First sentence of fourth paragraph:
The second reason … Has to do WITH the often-noted
Walking THROUGH the site, Through, Not though. Second bullet point.
controller action and HTML method -> controller action and HTTP method