small medium large xlarge

27 Sep 2017, 17:00
David Wilbur (50 posts)

first I should say I have not tried to repeat this… it would mean starting over at the creation of depot. up to this point I used all update url documents referenced in the book vs typing them in.

the books says: “No tests fail, but a peek into our log/test.log reveals a thwarted attempt to breach security”

however rails test:controllers resulted in:

Run options: –seed 20138



Failure: CartsControllerTest#test_should_destroy_cart [/some_more_directories_here/depot/test/controllers/carts_controller_test.rb:42]: “Cart.count” didn’t change by -1. Expected: 1 Actual: 2

bin/rails test test/controllers/carts_controller_test.rb:41


Finished in 0.553561s, 41.5492 runs/s, 61.4205 assertions/s. 23 runs, 34 assertions, 1 failures, 0 errors, 0 skips

this lead me to thinking that I had missed something along the way. however, it was actually not until I had updated a little further on to rails51/depot_i/test/controllers/carts_controller_test.rb that the error went away.

01 Oct 2017, 16:14
David Copeland (491 posts)

Hmm. I’ve submitted this as an errata. Not sure we’ll be able to change the text at this point in the process, but if I can I will.

07 Oct 2017, 14:33
David Copeland (491 posts)

Looked into this and I could not reproduce it.

I started with the code in depot_g, and one test is failing, which is correct. The text on page 140 has the reader fix that test by changing the assert. At this point, all tests pass.

Proceeding to Iteration E2, after making the change to the controller on page 142, the tests are still passing.

You must be logged in to comment