开发者

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

开发者 https://www.devze.com 2023-01-29 22:48 出处:网络
I have some simple rspec tests that check开发者_Go百科 if a particular page\'s title is \'xxxx\'.

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

精彩评论

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