timreganporter

timreganporter

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.

Most Liked

davetron5000

davetron5000

Author of Rails, Angular, Postgres, and Bootstrap

Hey, sorry for taking a while to reply—was on vacation.

As background, the code listings and terminal output in the book is generated from a script that does what the book is explaining to do, so the first two things I can suggest would be:

  1. Compare your code with the downloadable examples as of this chapter. The code in Interation H2 is based on what’s in depot_pc so you can use that as a reference to see what’s working
  2. If that doesn’t work, can you can post your work-in-progress repo on e.g. GitHub, I can take a look.

I guess all that’s to say, the code should work and tests should pass or at least behave the way the book says. If that’s not your experience, try the two things above and, it’s always possible Rails changed something that breaks the book in a subtle way…it wouldn’t be the first time :slight_smile:

Where Next?

Popular Pragmatic Bookshelf topics Top

belgoros
Following the steps described in Chapter 6 of the book, I’m stuck with running the migration as described on page 84: bundle exec sequel...
New
lirux
Hi Jamis, I think there’s an issue with a test on chapter 6. I own the ebook, version P1.0 Feb. 2019. This test doesn’t pass for me: ...
New
JohnS
I can’t setup the Rails source code. This happens in a working directory containing multiple (postgres) Rails apps. With: ruby-3.0.0 s...
New
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
adamwoolhether
I’m not quite sure what’s going on here, but I’m unable to have to containers successfully complete the Readiness/Liveness checks. I’m im...
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
oaklandgit
Hi, I completed chapter 6 but am getting the following error when running: thread 'main' panicked at 'Failed to load texture: IoError(O...
New
akraut
The markup used to display the uploaded image results in a Phoenix.LiveView.HTMLTokenizer.ParseError error. lib/pento_web/live/product_l...
New
dachristenson
I just bought this book to learn about Android development, and I’m already running into a major issue in Ch. 1, p. 20: “Update activity...
New

Other popular topics Top

Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
dimitarvp
Small essay with thoughts on macOS vs. Linux: I know @Exadra37 is just waiting around the corner to scream at me “I TOLD YOU SO!!!” but I...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New

Latest in Agile Web Development with Rails 6

Agile Web Development with Rails 6 Portal

Sub Categories: