문제

I'm working through Michael Hartl's excellent Rails 3 Tutorial book, but I am stuck at section 3.2.2. in which he refers to rspec tests being auto-generated from

rails generate Pages home contact
rails generate rspec:install

I've noticed a few points in which the current releases of gems differ, and that's expected, but all I see in my spec directory is a file called 'spec_helper.rb'. So I'm missing the following directories that, according to the tutorial, should exits:

spec/helpers
spec/views
spec/controllers

Is this something RSpec or Rails no longer generates?

도움이 되었습니까?

해결책

You must be using the 3.0 version of the tutorial - you'll be much happier if you use the 3.2 version instead. It's so new that it might actually still be in beta, but I'm almost done with it now and pretty much everything has worked exactly as listed, which is awesome.

(I also did the 3.0 version a month or so ago and had the same issues as you with things being out of date here and there. The testing suite in particular is majorly different between the two versions.)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top