Erratum(?): Agile Web Development with Rails 7.2, Validation and Unit Testing (~page 92)

@rubys

I have encountered different errors there, originating from the duplicated title.

Solution was to create a product with another title instead.

test "should create product" do
    assert_difference("Product.count") do
      part2_title = @product.title + " part2"
      post products_url, params: { product: { description: @product.description, image_url: @product.image_url, price: @product.price, title: part2_title } }
    end

    assert_redirected_to product_url(Product.last)
  end

Also - I have not seen the ‘The asset “MyString” is not present in
the asset pipeline.’ error at all.

Running on Rails 8.0.0.beta1 so maybe this is the reason (?)