small medium large xlarge

24 Jun 2017, 01:50
Justin Dickerson (1 post)

Where is this error coming from as it does not make sense! Below is the output, any clue is appreciated!

Finished in 0.121944s, 8.2005 runs/s, 0.0000 assertions/s. 1 runs, 0 assertions, 0 failures, 1 errors, 0 skips Justin-Dickersons-MacBook:depot dj911ice$ rails test:models Run options: –seed 14149



Error: ProductTest#test_product_attributes_must_not_be_empty: ActiveRecord::Fixture::FixtureError: table “products” has no column named “image_url”.

bin/rails test test/models/product_test.rb:7

24 Jun 2017, 13:47
David Copeland (491 posts)

That error message means that Rails is expecting the PRODUCTS database table to have the column image_url in it. On page 76 of the current Beta, we created the PRODUCTS table, and it has the image_url field in it.

A few things to check:

  • Have you run bin/rails db:migrate?
  • If so, try running bin/rails db:migrate RAILS_ENV=test You should not have to do that, but sometimes it can fix problems like this.
  • Check the contents of your db/migrate folder and see what’s in the XXXXX_create_products.rb file (XXXXX will depend on the date/time you created the migration, but hopefully it’ll be obviousl which file)
You must be logged in to comment