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

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New
jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=> (create-...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
jdufour
Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
New
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
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
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New

Other popular topics Top

AstonJ
Or looking forward to? :nerd_face:
New
AstonJ
poll poll Be sure to check out @Dusty’s article posted here: An Introduction to Alternative Keyboard Layouts It’s one of the best write-...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
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
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New

Latest in Agile Web Development with Rails 6

Agile Web Development with Rails 6 Portal

Sub Categories: