7
Rspec没有看到我的模型Class。未初始化的常量错误
我正在Ruby on Rails应用程序中针对我的模型在Rspec上编写测试。并且在启动“ rspec spec”时收到此错误 command: /spec/models/client_spec.rb:4:in `<top (required)>': uninitialized constant Client (NameError) 我使用Rails 4.0.0和Ruby 2.0.0 这是我的client_spec.rb: require 'spec_helper' describe Client do it 'is invalid without first_name', :focus => true do client = Client.new client.should_not be_valid end end 和Gemfile: source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' …