Agile Web Development with Rails 6 - more system tests need correcting (Iteration H2)

On Iteration H2, we run systems tests for the first time. There are instructions to fix products_test.rb but there are a number of other places to fix. After the fix in the book, the tests still generate 2 failures and 5 errors (at least for me – but I’m pretty sure I haven’t deviated from the book and all of the other tests (controllers and models) run find and my application seems to behave fine in the development environment).

Most of the problems seem to stem from the functionality that is no longer the default from scaffolding.

  • Carts test generates 2 errors in looking for “Back.”
  • Carts test generates a failure looking for the default cart destroyed message.
  • Line items test generates an error in creating a line item (“couldn’t find Product without an ID”).
  • Orders test has 2 errors for updating, one because it is unable to find pay type that is not disabled and one because the button doesn’t say “Update Order”
  • Orders test errors in creating (Unable to find Address) – I assume that’s because the cart is empty and doesn’t display the form.

Most of these tests (with the exception of outdated nav and messaging in the carts test) are for functionality that doesn’t match what we need and those tests can be commented out.

2 Likes