Rspec doesn't see my model Class. uninitialized constant error

后端 未结 7 1911
予麋鹿
予麋鹿 2021-01-30 19:09

I\'m writing tests on Rspec for my models in Ruby on Rails application. And I receive this error while starting \'rspec spec\'

command:
/spec/models/client_spec         


        
7条回答
  •  醉酒成梦
    2021-01-30 19:59

    You might also like to add --require rails_helper in your .rspec file so that it looks like this.

    --color
    --require spec_helper
    --require rails_helper
    

    You won't need to require rails_helper in all your specs, after this.

提交回复
热议问题