small medium large xlarge

17 Oct 2017, 01:34
Adrianus Johan (1 post)

Hi All,

newb question here,

on Chapter 7 Iteration B1: Validating!, (page 81) after you add validation to model

class Product < ActiveRecord::Base
	validates :title, :description, :image_url, presence: true
	validates :price, numericality: {greater_than_or_equal_to: 0.01}
	validates :title, uniqueness: true
	validates :image_url, allow_blank: true, format:{
		with: %r{\.(gif|jpg|png)\Z}i,
		message: 'must be a URL for GIF, JPG, or PNG image.'

and do

rake test

I should get 2 test failures. instead, i got 0 test run

Finished tests in 0.001160s, 0.0000 tests/s, 0.0000 assertions/s.

0 tests, 0 assertions, 0 failures, 0 errors, 0 skips

did i miss something? seems like the test does not even executed.

Thanks before!

You must be logged in to comment