开发者

rspec tests are failing b/c application_controller is making db calls

I have some simple rspec tests that check开发者_Go百科 if a particular page's title is 'xxxx'.

I added some before_filter's to my application_controller which makes db calls.

Should I be mocking these out somehow?

The tests are failing saying "mysql2::error table myapp_test.articles doesn't exist.


That sounds more like you need to run rake db:test:prepare or rake db:migrate db:test:prepare to me. Do you have something set up so your rspecs fail when they hit the database intentionally?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜