Here my repo : https://github.com/roelof1967/commerce-try
Roelof Op woensdag 10 december 2014 07:42:47 UTC+1 schreef Roelof Wobben: > I did also rails g rspec:install otherwise rspec do not give output. > > Roelof > > > Op woensdag 10 december 2014 00:23:21 UTC+1 schreef Carlos Figueiredo: > >> Minitest is the default test suite on Rails. >> >> Did you just installed rspec-rails gem, or did you also run `rails >> generate rspec:install` ? >> >> Because `rails generate rspec:install` configures you env to run rspec. >> >> Carlos >> >> On Tue, Dec 9, 2014 at 7:12 PM, Roelof Wobben <[email protected]> wrote: >> >>> >>> I use the rspec rails gem . >>> >>> I found this in the gem file : >>> >>> gem "rspec-rails", "~> 2.14.0" >>> >>> If you want , I can upload this project to my personal github page. >>> >>> How can I print out the product.errors ? >>> >>> Roelof >>> >>> Op dinsdag 9 december 2014 21:53:35 UTC+1 schreef Myron Marston: >>> >>>> On Tuesday, December 9, 2014 11:05:26 AM UTC-8, Roelof Wobben wrote: >>>>> >>>>> I will cut the error message in two. >>>>> >>>>> the minitest error message : >>>>> >>>>> Warning: you should require 'minitest/autorun' instead. >>>>> >>>>> >>>>> Warning: or add 'gem "minitest"' before 'require " >>>>> minitest/autorun"' >>>>> >>>>> and the Rspec error message : >>>>> >>>>> Failures: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> 1) Product is valid with a productname, description and >>>>> a image_url >>>>> >>>>> Failure/Error: expect(product).to be_valid >>>>> >>>>> >>>>> expected valid? to return true, got false >>>>> >>>>> >>>>> # ./spec/model/product_spec.rb:10:in `block (2 >>>>> levels) in <top (required)>' >>>>> >>>>> Roelof >>>>> >>>> >>>> The expectation failure is telling you that `product.valid?` did not >>>> return true as expected. It's impossible for us to say what specifically >>>> is making it invalid. You'll have to check `product.errors` to see what >>>> the validation errors are. It looks like your spec is running without >>>> rspec-rails loaded (since `be_valid` isn't providing the errors -- the >>>> default `be_valid` matcher in rspec-expectations just checks `valid?` but >>>> doesn't know to look for `errors`). If you load `rspec-rails`, an >>>> improved >>>> `be_valid` matcher is available that will include the validation errors in >>>> the failure message: >>>> >>>> https://github.com/rspec/rspec-rails/blob/v3.1.0/lib/ >>>> rspec/rails/matchers/be_valid.rb >>>> >>>> If you use that, it should pinpoint what the validation error is, and >>>> then you can fix it. >>>> >>>> HTH, >>>> Myron >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "rspec" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/rspec/a68be083-ab07-437b-b3ec-4ddb9a978b5d%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/rspec/a68be083-ab07-437b-b3ec-4ddb9a978b5d%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- You received this message because you are subscribed to the Google Groups "rspec" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/fe172711-cf89-4ac1-9d3b-f9362c673857%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
